Program creating and executing apparatus, and program creating and executing method
The program creation/execution device automates network device configuration using REST APIs and Ansible, addressing the inefficiencies in managing multiple network devices by generating configuration files and programs, thereby reducing manual effort and enhancing system construction efficiency.
Patent Information
- Application Number
- JP2023067659
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-04-18
- Publication Date
- 2024-10-30
AI Technical Summary
Existing systems require significant manual effort and man-hours to configure and manage multiple network devices using REST APIs, with existing tools like Ansible and Swagger Editor not fully addressing compatibility and automation needs.
A program creation/execution device that generates system configuration files and programs from REST APIs, incorporating execution history and analysis to automate the configuration of network devices, reducing manual effort through the use of Ansible and REST APIs.
Facilitates easier construction of network systems by automating the configuration of multiple devices, reducing the time and effort required for system developers to manage complex network setups.
Smart Images

Figure 2024154055000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to a program creation and execution device and a program creation and execution method, and in particular to a program creation and execution device and a program creation and execution method that are suitable for reducing the effort required to configure a network system by generating a program from a REST API and enabling the configuration of network devices. [Background technology]
[0002] In recent years, with the advancement of network technology and changes in the way companies think about work, remote work has become widespread, and the network configuration has changed from a form in which the intranet connects to private clouds / public clouds to a form in which the intranet also connects to private clouds / public clouds. To achieve this, the use of SASE (Secure Access Service Edge) products and services is expanding. SASE is a general term for technologies that expand the scope of network safety beyond specific networks such as within a company and provide integrated network and security functions in the cloud. Technologies included in SASE include SD-WAN (Software Defined Wide Area Network) and SWG (Secure Web Gateway). SD-WAN is a technology that flexibly controls the routes of physical WANs (Wide Area Networks) that connect bases using software. On the other hand, SWG is a technology that provides secure access to private clouds / public clouds from inside and outside the intranet by providing the function of a gateway to the Internet on the cloud side rather than at the boundary between the intranet and the Internet. SASE is made up of multiple products and services, and cannot be realized with a single product or service. As a result, systems have become more complex, and the burden of setting and operating them is increasing. Therefore, each product and service provides an API (Application Programming Interface) so that they can be controlled programmatically and so that they can connect with each other.
[0003] System developers need to set parameters such as network device configuration for the system they are developing, and develop programs that will run on the system. However, the larger the system, the more development work becomes necessary, and maintenance such as customization requires a huge amount of labor.
[0004] Patent Document 1 discloses a technique for updating generic parameters to match individual parameters in order to efficiently develop system migration. According to the technique disclosed in Patent Document 1, a setting file consisting of generic parameters is prepared, and settings and information acquisition are possible simply by updating the generic parameters to individual parameters according to the case.
[0005] Meanwhile, the Representational State Transfer Application Programming Interface (REST API) has been proposed to allow systems to exchange information simply and efficiently using APIs. The REST API is an API philosophy (including the principles of uniform interface, addressability, connectability, and statelessness) and does not prescribe specific standards, but is generally implemented to perform settings and obtain information by sending Hyper-Text Transfer Protocol (HTTP) messages carrying parameters to the Uniform Resource Locator (URL) of the product or service to be configured.
[0006] Non-Patent Document 1 discloses an editor that can automatically generate part of a Web client program from the REST API specifications.
[0007] Ansible is also provided as an infrastructure construction automation tool based on the programming language Python (Non-Patent Document 2). Ansible is an open source configuration management tool that streamlines and automates the management of IT devices, and by using it, the burden on administrators is said to be greatly reduced because the complicated configuration work of IT devices is automated. Ansible uses definition files (Playbooks) in YAML format that allow for intuitive description, so no advanced programming knowledge is required for configuration, making it an easy-to-introduce configuration management tool. [Prior art documents] [Patent documents]
[0008] [Patent Document 1] JP 2020-61019 A [Non-patent literature]
[0009] [Non-Patent Document 1] “Swagger Editor”, SMARTBEAR, [online], [searched on February 18, 2020],<URL:https: / / swagger.io / tools / swagger-editor / > [Non-Patent Document 2] : “Red Hat Ansible”, RedHat, Inc., [online], [searched on February 18, 2020],<URL:https: / / www.ansible.com / > Summary of the Invention [Problem to be solved by the invention]
[0010] In order to execute functions using the REST API, a system developer must separately create a Web client program that supports the REST API. Here, by using the technology disclosed in Non-Patent Document 1, it is possible to automatically generate a part of the Web client program from the REST API specifications. However, such an automatically generated program is merely a part of a program that enables the setting and information acquisition of a single product or service, and when managing multiple products or services in an integrated manner, a program that realizes this must be manually created.
[0011] On the other hand, by using Ansible as described in Non-Patent Document 2, it is possible to manage multiple products and services with a configuration file called a Playbook. For example, it is possible to define in the same Playbook that the configuration of a certain product or service is changed according to the result of configuring another product or service, or according to information obtained from a certain product or service. However, since a system does not necessarily support Ansible, in such cases, a system developer must individually develop a Playbook or a system-specific configuration program.
[0012] In addition, the technology related to system configuration parameters in the above Patent Document 1 aims to efficiently perform the development of system migration by updating the general parameters so that they are consistent with the individual parameters. However, the configuration file must be created manually in the first place, and it takes time to obtain the general parameters of the system. In addition, when a product or service is added or when the configuration of the product or service is changed, the configuration file must be created or changed manually each time.
[0013] An object of the present invention is to provide a program creation and execution device and a program creation and execution method which, when the system is configured using a REST API, enables the configuration of network devices that make up the system by generating system configuration files and programs from the REST API, thereby reducing the effort required to build a network system and the man-hours required by system developers. [Means for solving the problem]
[0014] The configuration of the program creation and execution device of the present invention is preferably a program creation and execution device that creates a program based on a command including API (Application Programming Interface) information and executes the created program, which has execution history information data of methods and parameters of the command including API information and analysis result information data obtained by analyzing the execution history information data, and is configured to periodically create a configuration file and a program that achieves the same function as the command including API information based on the analysis result information data. Effect of the Invention
[0015] According to the present invention, it is possible to provide a program creation and execution device and a program creation and execution method that, when a system is configured using a REST API, generate a system configuration file and a program from the REST API, thereby enabling the configuration of network devices that make up the system, thereby reducing the effort required to build a network system and the man-hours required by system developers. [Brief description of the drawings]
[0016] [Figure 1] 1 is a block diagram showing an example of the configuration of a network system according to a first embodiment. [Diagram 2] FIG. 2 is a block diagram showing the functional configuration of a program creation and execution device. [Diagram 3] 2 is a block diagram showing a functional configuration of a communication path providing device; FIG. [Figure 4] FIG. 2 is a block diagram showing a functional configuration of a security providing device. [Diagram 5] FIG. 2 is a block diagram showing the hardware and software configuration of a program creation and execution device. [Figure 6] FIG. 2 is a block diagram showing the hardware and software configuration of a communication path providing device. [Figure 7] 2 is a block diagram showing the hardware and software configuration of the security providing device. FIG. [Figure 8] FIG. 13 is a diagram illustrating an example of causing a program creation and execution device to execute a command including a REST API. [Figure 9] FIG. 13 is a diagram illustrating an example of causing a program creation and execution device to execute Ansible. [Figure 10] FIG. 13 is a diagram illustrating an example of an analysis result information data table. [Figure 11] FIG. 11 is a diagram illustrating an example of a threshold information data table. [Figure 12] FIG. 11 is a sequence diagram showing a series of processes for analyzing command execution including a REST API and storing analysis result information data. [Figure 13] This is a sequence diagram showing a series of processes to generate a Playbook and an Ansible execution program and execute them as an Ansible function. [Figure 14] This is a flowchart showing the process of analyzing the REST API execution history and generating a Playbook and an Ansible execution program. [Figure 15] 11 is a flowchart showing the details of a process for generating a Playbook and an Ansible execution program. [Figure 16] FIG. 13 is a diagram showing an example of a Playbook created by the program creation and execution device. [Figure 17] FIG. 2 is a diagram illustrating an example of an Ansible execution program created by the program creation and execution device. [Figure 18] FIG. 13 illustrates an example of a program creation utility screen. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0017] Hereinafter, a first embodiment of the present invention will be described with reference to FIGS.
[0018] First, the configuration of a network system according to the first embodiment will be described with reference to FIGS.
[0019] The network system has a configuration in which one or more bases 300 and one or more data centers 400 are connected via the Internet 1. In this embodiment, an example will be described assuming an SD-WAN configuration in which a user can enjoy cloud services provided by the data center 400 from the base 300. As already explained, SD-WAN refers to technology and services that apply SDN (Software Defined Networking) technology, which controls a network by software, to a WAN and realizes flexible network configuration and traffic control in inter-base connections, cloud connections, and the like.
[0020] One or more communication path providing devices 20 (in FIG. 1, indicated as 20a, 20b, 20c, ...) and one or more user terminals 40 (in FIG. 1, indicated as 40a, 40b, 40c, ...) are installed in the base 300. The communication path providing devices 20 are, for example, network devices such as switches that realize an SD-WAN.
[0021] The user terminal 40 is a device that transmits and receives data to and from other sites such as a data center 400 via the communication path providing device 20 and the Internet 1, and is, for example, an information processing device such as a PC (Personal Computer), a tablet PC, or a smartphone, or a sensor. The user terminal 40 transmits and receives data such as text, voice, and video to and from a server (not shown) of another site connected to the Internet 1. For example, in FIG. 1, the user terminal 40a transmits and receives data such as text, voice, and video to and from an external server connected to the Internet 1 via the communication path providing device 20a.
[0022] The communication path providing device 20 provides a communication path to another base 300 or a data center 400 on the Internet 1 by constructing a virtual communication path called an IPsec (IP security) tunnel 7 (indicated as 7a and 7b in FIG. 1). Here, IPsec is a communication standard for realizing a VPN (Virtual Private Network), and in the IPsec tunnel mode, the IP header of the original IP packet is encrypted, a new IP header is added, and the datagram of the IP packet is also encrypted, thereby encrypting the entire IP packet. It is also assumed that the communication path providing device 20 of this embodiment supports the function of the HTTP protocol.
[0023] When the communication path providing device 20 receives data from a user terminal 40 connected by a LAN (Local Area Network) 3 within the base, it transfers the data to an IPsec tunnel 7b to another base 300 or a data center 400 depending on the destination. Alternatively, it transfers the data directly to another site via the Internet 1 without tunneling the data. Then, when data addressed to the user terminal 40 is received from the IPsec tunnel 7 connected to the other base 300 or the data center 400, it transfers the data to the user terminal 40. Also, when data addressed to the user terminal 40 is received from the Internet 1, it transfers the data to the user terminal 40.
[0024] The data center 400 is a site where a program creation and execution device 100, a security providing device 30, a communication path providing device 20, virtual terminals 50 (in FIG. 1, shown as 50a and 50b), and a server providing cloud services (not shown) are installed and connected via a LAN 5.
[0025] The security providing device 30 is, for example, a network device having a communication security function. The security providing device 30 has a function of monitoring transmitted data and determining whether the connection is permitted or not. When the security providing device 30 receives a packet from the user terminal 40 via the IPec tunnel 7, it determines whether the connection is permitted or not, and if it determines that the connection is permitted, it forwards the packet to the destination via the Internet 1, and if it determines that the connection is not permitted, it discards the packet there without forwarding it to the destination. It is also assumed that the security providing device 30 of this embodiment supports the function of the HTTP protocol.
[0026] The program creation and execution device 100 is a device that collects data related to REST APIs, creates a playbook and an Ansible execution program, and executes the created playbook and Ansible execution program in an environment in which Ansible operates. In this embodiment, an example of executing a program that sets one or more communication path providing devices 20 and one or more security providing devices 30 will be described. The program creation and execution device 100 performs settings required to establish an IPsec tunnel communication path for the communication path providing devices 20a and 20b in the configuration of FIG. 1, and performs settings of destinations to which connections are permitted or not permitted for the security providing device 30.
[0027] The virtual terminal 50 is a terminal that is realized by simulating a physical (hardware) terminal by software as part of a cloud service. The program creation and execution device 100 may perform settings for the virtual terminal 50 by executing an Ansible execution program.
[0028] The configurations, types, connection forms, and numbers of the base 300, data center 400, user terminal 40, virtual terminal 50, communication path providing device 20, security providing device 30, program creating and executing device 100, and virtual terminal 50 are not limited to the example shown in Fig. 1, and may be other modes as appropriate. For example, the program creating and executing device 100 may be included in the base 300.
[0029] Next, the functional configuration of each component will be described with reference to FIG. 2 to FIG.
[0030] As shown in FIG. 2, the program creation and execution device 100 has, as its functional configuration, a user interface unit 105, a program creation unit 110, a program execution unit 120, and a storage unit .
[0031] The user interface unit 105 is a functional unit that receives commands including REST APIs from the outside and commands for executing Ansible.
[0032] The program creation unit 110 is a functional unit that creates a Playbook and an Ansible execution program based on the REST API execution history information data 71. The program creation unit 110 has an execution history information acquisition and analysis unit 111 and a configuration file and execution code generation unit 112 as sub-functional units.
[0033] The execution history information acquisition and analysis unit 111 is a functional unit that acquires and analyzes execution history information related to the REST API. The configuration file and execution code generation unit 112 is a functional unit that generates the code of the Playbook and the Ansible execution program based on the execution history information related to the REST API.
[0034] The program execution unit 120 is a functional unit that executes an OS (Operating System) and application programs that run on the program creation and execution device 100, and in particular, in this embodiment, executes an Ansible package, a Playbook that runs on it, and an Ansible execution program. The storage unit 130 is a functional unit that stores data used by the program creation and execution device 100.
[0035] The storage unit 130 of the program creating and executing device 100 holds threshold information data 70, execution history information data 71, and analysis result information data 72. Details of each data will be explained later.
[0036] As shown in FIG. 3, the communication path providing device 20 has a device control unit 21 and a memory unit 24. The device control unit 21 is a functional unit that controls the communication path providing device 20 and communicates according to the setting contents. The device control unit 21 has, as sub-functional units, a setting content receiving unit 22 and a communication control unit 23. The setting content receiving unit 22 is a functional unit that receives information on the setting contents for the communication path providing device 20 from the outside. The communication control unit 23 is a functional unit that controls communication according to the setting contents. The memory unit 24 is a functional unit that stores data used in the communication path providing device 20.
[0037] The storage unit 24 of the communication path providing device 20 holds device setting information data 73. The device setting information data 73 is, for example, setting data related to a communication path such as routing and virtualization of a communication port used for communication.
[0038] As shown in Fig. 4, the security providing device 30 has a device control unit 31 and a storage unit 34, similar to the communication path providing device 20 shown in Fig. 3. The device control unit 31 also has, as sub-functional units, a setting content receiving unit 32 and a communication control unit 33. The functions of each unit are similar to those of the communication path providing device 20.
[0039] The device setting information data 74 held in the storage unit 34 is, for example, setting data for blocking IP packets of a specific IP address.
[0040] Next, the hardware and software configuration of each component will be described with reference to FIGS.
[0041] The hardware configuration of the program creation and execution device 100 is realized by, for example, a general information processing device such as a PC shown in FIG.
[0042] The program creation and execution device 100 includes a CPU (Central Processing Unit) 150, a main memory 151, a network I / F (Interface) 152, a display I / F 153, an input / output I / F 154, and an auxiliary storage I / F 155, all of which are connected via a bus.
[0043] The CPU 150 controls each unit of the program creation and execution device 100, and loads and executes necessary programs into the main memory 151. Note that the program creation and execution device 100 may have multiple CPUs or execution cores.
[0044] The main memory 151 is generally configured as a volatile memory such as a RAM, and stores the programs executed by the CPU 150 and data referenced by the CPU 150.
[0045] The network I / F 152 is an interface for connecting to the LAN 5 .
[0046] The display I / F 153 is an interface for connecting a display device 180 such as an LCD (Liquid Crystal Display).
[0047] The input / output I / F 154 is an interface for connecting input / output devices. In the example of Fig. 5, a keyboard 191 and a mouse 192 which is a pointing device are connected.
[0048] The auxiliary storage I / F 155 is an interface for connecting an auxiliary storage device such as a hard disk drive (HDD) 157 or a solid state drive (SSD).
[0049] The HDD 157 has a large storage capacity and stores programs for executing the present embodiment. A user interface program 161, an execution history information acquisition and analysis program 162, a configuration file and execution code generation program 163, and an Ansible package 171 are installed in the program creation and execution device 100, and the program creation and execution device 100 holds a Playbook 172 created by the program creation and execution device 100 and an Ansible execution program 173.
[0050] A user interface program 161, an execution history information acquisition and analysis program 162, and a setting file and execution code generation program 163 are programs which respectively realize the functions of the user interface unit 105, the execution history information acquisition and analysis unit 111, and the setting file and execution code generation unit 112.
[0051] Ansible package 171 is a package program of Ansible provided by a vendor or open software. Playbook 172 is a YAML format configuration file for executing Ansible. Ansible execution program 173 is a program created by the program creation and execution device 100 and executed on Ansible.
[0052] The OS and other application programs are installed in the HDD 157, but are omitted from FIG.
[0053] Furthermore, the HDD 157 stores threshold information data 70, execution history information data 71, and analysis result information data 72.
[0054] Some or all of the programs and data used in the program creation and execution device 100 may be stored in advance in the HDD 157, or may be introduced from a non-transitory storage medium such as a USB memory, or from an information processing device equipped with an external non-transitory storage device via a network.
[0055] The communication path providing device 20 is realized as an intelligent communication device having a hardware configuration as shown in FIG.
[0056] The communication path providing device 20 includes an MPU (Micro Processing Unit) 25, a main memory 26, a ROM (Read Only Memory) 27, a non-volatile memory 28, and a packet transmission / reception port 29, all of which are connected via a bus.
[0057] The MPU 25 controls each unit of the communication path providing device 20, and executes the program written in the ROM 27. The main memory 26 holds programs and data. A setting content receiving program 51 and a communication control program 52 are written in the ROM 27, and are executed by the MPU 25. The setting content receiving program 51 and the communication control program 52 are programs that respectively realize the functions of the setting content receiving unit 22 and the communication control unit 23. The non-volatile memory 28 is a semiconductor memory such as a flash memory that retains information even when the power is turned off. The non-volatile memory 28 of the communication path providing device 20 stores device setting information data 73. The packet transmission / reception port 29 is a mechanism that serves as an input / output port for transmitting and receiving IP packets.
[0058] As shown in FIG. 7, the hardware and software configuration of the security providing device 30 is similar to that of the communication path providing device 20 shown in FIG.
[0059] Next, an example of causing the program creation and execution device 100 to execute a command including a REST API and an example of causing the program creation and execution device 100 to execute Ansible will be described with reference to FIGS. 8 and 9. FIG.
[0060] In this embodiment, an example in which the communication path providing device 20 and the security providing device 30 are set as commands including a REST API to be executed by the program creation and execution device 100 will be mainly described.
[0061] A system developer inputs a command as shown in Fig. 8 from a shell environment 500 provided by a user interface program 161. The example shown in Fig. 8 is an example of sending an http message to a network device by using a curl command.
[0062] The curl command shown in FIG. 8 is input by concatenating it with the character string "curl" of command 501 that transmits an HTTP message. In the example shown in FIG. 8, "POST" of method 502 is specified as the "-X" option of the curl command. Method 502 specifies POST, GET, PUT, DELETE, etc., and means setting, referencing, updating, and deleting of configuration item 505, respectively. Next, message 503 is written as the "-d" option of the curl command. The "-d" option of the curl command is an option for specifying parameters when the method is POST. Message 503 is written in JSON (JavaScript Object Notation) format, and in this example, it is the value of a parameter related to configuration item 505.
[0063] The address 504, the setting item 505, and the setting item identifier 506 are expressed as part of a URL (Uniform Resource Locator, detailed syntax is in RFC 3986) for sending the method of the curl command.
[0064] The address 504 is information indicating a protocol indication and a host address (in this embodiment, an address that identifies the communication path providing device 20 or the security providing device 30). Below that is a URL resource path, a setting item 505, and a setting item identifier 506. In this embodiment, the setting item 505 specifies an item that can be set in the communication path providing device 20 or the security providing device 30. The setting item for the communication path providing device 20 includes an IPsec tunnel setting, etc. The setting item for the security providing device 30 includes a destination setting for allowing or denying connection, etc. Specific examples of setting items will be described later with reference to FIG. 10. When there are multiple setting items 505, the setting item identifier 506 specifies a value for specifying one of them.
[0065] When a command including this REST API is executed, it is converted into an HTTP message by command execution of the shell of the programming and execution device 100, and is sent to the communication path providing device 20 and the security providing device 30. The programming and execution device 100 also stores the execution history in the execution history information data 71. When the communication path providing device 20 and the security providing device 30 receive the HTTP message at the setting content receiving unit 22, they configure the device using the function of the communication control unit 23.
[0066] Next, an example of causing the program creation and execution device 100 to execute Ansible will be described with reference to FIG. FIG. 9 shows an execution example of input from a shell when configuring the communication path providing device 20 and the security providing device 30 using Ansible.
[0067] When executing Ansible, the command 601 “ansible-playbook” is executed by specifying the playbook file name 602 (in the example of FIG. 9, “set_ipsec.yaml”).
[0068] When this command is executed, the Ansible program runs based on the contents specified in the Playbook. If a process for executing a REST API is described in the Ansible program, that process is executed. When the REST API is executed, the program execution unit 120 of the program creation and execution device 100 converts it into an HTTP message and sends it to the destination (the communication path providing device 20 or the security providing device 30 in this embodiment). Also, if a process for executing a command is described in the Ansible program, the command is executed.
[0069] Next, data used in the program creating and executing device 100 will be described with reference to FIG. 10 and FIG.
[0070] The analysis result information data 72 is expressed in a format such as an analysis result information data table 720 shown in Fig. 10. The analysis result information data table 720 is a table that stores information indicating the analysis results of the execution history of the REST API, and as shown in Fig. 10, has fields for a setting item 720a, a setting item usage count 720b, a method 720c, a parameter 720d (in the example of Fig. 10, there are three parameters, with parameter 1: 720d1, parameter 2: 720d2, and parameter 3: 720d3), a setting item identifier 720e, an address 720f, and a method usage count 720g.
[0071] The setting item 720a is an item that can be set by the communication path providing device 20 or the security providing device 30. In the example of FIG. 10, "Destination", "ipsec", and "policy" are specified. The setting item usage count 720b is the number of times that the setting item described in the setting item 720a has been used in the REST API within a certain period (for example, the past month). As already explained in FIG. 8, the method 720c includes POST, GET, PUT, DELETE, and the like. The parameter 720d is the value of a parameter related to the setting item described in the setting item 720a. The setting item identifier 720e is a value that identifies one of the setting items 720a when multiple setting items 720a are set. The address 720f is an address that identifies the destination of the REST API (in this embodiment, the communication path providing device 20 or the security providing device 30). The method usage count 720g is a value obtained by counting the number of times that each method has been used for each setting item described in the setting item 720a within a certain period.
[0072] Note that the fields included in the analysis result information data table 720 are not limited to these, and it is also possible for the analysis result information data table 720 to not include any of these fields, or to include other fields.
[0073] The threshold information data table 700 is a table that stores the threshold value of the number of times for each item, and has fields for a target item 700a and a threshold 700b as shown in FIG. 11. The target item 700a stores information about the target for which the number of times of use is compared with the threshold. In the example of FIG. 11, "setting item" and "method" are specified. The threshold 700b stores a threshold corresponding to the target described in the target item 700a. The value of the threshold 700b means that when the number of times of use of an item of the REST API (number of times of use of setting item 720b in FIG. 10) is equal to or greater than the value stored in this threshold, the REST API is converted and realized by the Ansible execution program. The reason for this is that generating an Ansible execution program for a setting item or method that is used less frequently may result in poor efficiency in the use of storage capacity, whereas it is considered that a corresponding Ansible execution program is useful for a system operator for a setting item or method that is used more frequently.
[0074] The value specified in the item 700a may be something other than "setting item" and "method".
[0075] Next, a series of processes in which the program creation and execution device 100 generates an Ansible configuration file (hereinafter also simply referred to as a "Playbook") and an Ansible execution program from the REST API execution history and executes them as an Ansible function will be described with reference to FIGS. 12 to 15.
[0076] First, a series of processes for analyzing the execution of a command including a REST API and storing analysis result information data will be described with reference to FIG.
[0077] A network system operator 90 inputs a command including a REST API provided by the communication path providing device 20 or the security providing device 30 through the user interface unit 105 of the program creation and execution device 100 (A01). The command including the REST API includes the setting items to be set and parameters related to the setting items, as shown in Fig. 8. The program creation and execution device 100 accepts the input of the command and executes the command (S01), thereby converting the REST API used by the network system operator 90 into an HTTP message and transmitting it to the communication path providing device 20 or the security providing device 30 (A02).
[0078] When the communication path providing device 20 and the security providing device 30 receive the HTTP message, they configure their own devices based on the contents of the message (S02). Then, the communication path providing device 20 and the security providing device 30 respond with the configuration results to the program creating and executing device 100 (A03). The user interface unit 105 of the program creating and executing device 100 displays the results of executing the command including the REST API to the network system operator 90 (S03). In addition, the command execution history is stored as execution history information data 71 (S04).
[0079] Meanwhile, the execution history information acquisition and analysis unit 111 of the program creation and execution device 100 periodically (for example, once a day) refers to the execution history information data 71 and acquires the execution history information (S05). Once acquired, it counts the number of times each setting item and each method is used per unit time and analyzes the combination of parameters (S06). Then, it stores the analysis results as analysis result information data 72 (S07).
[0080] Next, using Figure 13, we will explain the series of processes to generate a Playbook and an Ansible execution program and execute them as an Ansible function. The program creation unit 110 of the program creation and execution device 100 reads the analysis result information from the analysis result information data 72 (S10). Then, based on the analysis result information, a Playbook and an Ansible execution program are generated (S11). The process of generating a Playbook and an Ansible execution program will be described in detail later.
[0081] When a network system operator 90 inputs an Ansible Playbook execution command such as the “ansible-playbook” command shown in FIG. 9 (A11), the user interface unit 105 executes the command (S12), and the program execution unit 120 performs Ansible processing (S20).
[0082] In the Ansible processing, Playbook 172 is executed (S21), and an Ansible execution program 173 is executed as a task of Playbook 172 (S22).
[0083] By executing the Ansible execution program 173, a REST API is generated, and the REST API is converted into an HTTP message and transmitted to the communication path providing device 20 and the security providing device 30 (A13). When the communication path providing device 20 and the security providing device 30 receive the HTTP message, they configure their own devices based on the contents of the message (S13). Then, they respond with the configuration results to the program creation and execution device 100 (A14). Finally, the user interface unit 105 of the program creation and execution device 100 displays the execution results of the command (S14). Note that the execution order of each process may be changed as long as the consistency of the processes is maintained.
[0084] In the above example, the network system operator 90 specifies a Playbook and executes Ansible to configure the communication path providing device 20 and the security providing device 30. However, the network system operator 90 can also create a Playbook and an Ansible execution program by referring to the generated Playbook and Ansible execution program, and use them to reduce the labor required for creating programs for configuring the communication path providing device 20 and the security providing device 30 and acquiring information.
[0085] Next, the process of analyzing the REST API execution history and generating a Playbook and an Ansible execution program will be described with reference to Figures 14 and 15.
[0086] The program creating section 110 of the program creating and executing device 100 periodically (for example, once a day) repeatedly executes the processes of S102 to S112 (S101 to S113, loop process L1).
[0087] In loop processing L1, first, the program creation and execution device 100 acquires the value of the threshold 700b where the target item 700a in the threshold information data table 700 is a "setting item" (S102). The program creation and execution device 100 also acquires analysis result information from the analysis result information data table 720 (S103). Then, the program creation and execution device 100 compares the value of the setting item usage count 720b with the value of the threshold 700b where the target item 700a is a "setting item" to determine whether the value of the setting item usage count 720b is equal to or greater than the value of the threshold 700b (S104). 11, if the value of the threshold 700b for the target item 700a being the "setting item" is 10 and the value of the number of times the setting item is used 720b is 100, the value is equal to or greater than the value of the threshold 700b (S104: YES), so the character string of the name stored in the setting item 720a in the analysis result information data table 720 is set as the setting item name of the Ansible execution program (described later in FIG. 17) and the task name of the Playbook (described later in FIG. 16) (S105). If the value of the threshold 700b for the target item 700a being the "setting item" is 10 and the value of the number of times the setting item is used 182 is less than 10 (S104: NO), the process returns to S101 and the same process is repeated for the next record in the analysis result information data table 720.
[0088] Next, the program creating section 110 of the program creating and executing device 100 repeatedly executes the processes of S107 to S112 (S106 to S111, loop process L2).
[0089] In the loop process L2, the value of the method usage count 720g in the method 720c of the record in the analysis result information data table 720 acquired in S103 is referenced, the value is acquired with the value of the threshold 700b in the threshold information data table 700 in which the target item 700a is "method", and the value of the method usage count 720g is compared with the value of the threshold 700b in the threshold information data table 700 in which the target item 700a is "method" to determine whether the value of the method usage count 720g is equal to or greater than the value of the threshold 700b (S107). For example, if the value of the threshold 700b in which the target item 700a is "method" is 10 and the value of the method usage count 720g is 50, the value of the method usage count 720g is equal to or greater than the threshold (S107: YES), so the value of the method 720c is stored in the method list (S108). The method list is a programming list that stores information on methods, and is referenced in S112 in a later step. In a similar example, if the value of the method use count 720g is less than 10, it is less than the value of the threshold 700b (S107: NO), so the process returns to S106 and a similar comparison is performed on the method use count 720g of the next method 720c having the same setting item 720a in the record of the analysis result information data table 720.
[0090] Next, the program creation unit 110 of the program creation and execution device 100 refers to the value of the parameter 720d for each method 720c of the record of the analysis result information data table 720, and if there is a parameter that is always used, it stores it as a required parameter in the required parameter list, and if there is a parameter that is not always used, it stores it as an optional parameter in the optional parameter list (S109). For example, in the example of FIG. 10, for a record in which the value of the setting item 720a is "Destination" and the value of the method 720c is "POST", the parameter 1: 720d1 is a required parameter, and the parameter 2: 720d2 and the parameter 3: 720d3 are optional parameters. The generation of a Playbook and an Ansible execution program using the required parameter list and the optional parameter list will be described later.
[0091] Next, the program creation and execution device 100 checks whether or not a value of the setting item identifier 720e is stored for each record of the value of the method 720c, and when a value of the setting item identifier 720e is stored, creates a setting item identifier parameter from the value of the setting item identifier 720e. Similarly, for each record of the value of the method 720c, an address parameter is created from the value of the address 720f (S110). Note that the generation of a Playbook and an Ansible execution program using the setting item identifier parameter and the address parameter will be described later.
[0092] After the loop process L2, the program creation unit 110 of the program creation and execution device 100 executes a process of generating a Playbook and an Ansible execution program based on the setting item name and task name in S105, the method list in S108, the required parameter list and optional parameter list in S109, and the setting item identifier parameter and address parameter in S110 (S112). Details of the process of generating a Playbook and an Ansible execution program will be described later with reference to FIG. 15.
[0093] Next, the process of generating a Playbook and an Ansible execution program will be described in detail with reference to FIG. 15. This process corresponds to S112 in FIG.
[0094] First, the program creation unit 110 of the program creation and execution device 100 creates an Ansible execution program file named using the setting item name set in S105 of Fig. 14 (S201). An Ansible execution program is described in the Ansible execution program file. Also, a Playbook file named using the task name set in S105 of Fig. 14 is created (S202). A Playbook is described in the Playbook file.
[0095] Next, the program creating section 110 of the program creating and executing device 100 repeatedly executes the processes of S204, and S211 to S242 (S203 to S205, loop process L3).
[0096] First, the method list set in S108 is referenced, and if a method is found in the list, branch processing is carried out according to the content of the method (S204).
[0097] If the method is POST or PUT, the following process is performed. First, if there are parameters in the required parameter list and optional parameter list set in S109, the program creation unit 110 of the program creation and execution device 100 declares them in the Ansible execution program. Also, if there is a configuration item identifier parameter set in S110, the program creation unit 110 declares the configuration item identifier in the Ansible execution program. Then, the address of the address parameter set in S110 is declared in the program.
[0098] Also, the process of acquiring parameters from the Playbook when the Playbook is executed by Ansible is written as an execution statement in the Ansible execution program. Then, the process of setting the above address, setting item name, and setting item identifier in the URL, setting the above required parameter list and optional parameter list as the payload, and the process of sending an HTTP message specifying the URL and payload are written (S211, S221).
[0099] Next, the program creation unit 110 of the program creation and execution device 100 defines in the Playbook a task name that is the same as the Ansible execution program file name created in S201, and declares the method, required parameter list, optional parameter list (if there are parameters in those parameter lists), configuration item identifier (if there are configuration item identifier parameters), and the address of the address parameter as parameters required when executing the task (S212, S212).
[0100] If the method is GET, the processes of S231 and S232 are executed; if the method is DELETE, the processes of S241 and S242 are executed.
[0101] In S231 when the method is GET and in S241 when the method is DELETE, unlike S211 and S221, there is no need to set the required parameter list and optional parameter list in the payload, and so the processing is omitted.
[0102] Next, specific examples of Playbooks and Ansible execution programs that are created and executed by the program creation and execution device will be described with reference to FIGS. 16 and 17.
[0103] The program creation unit 110 of the program creation and execution device 100 creates a Playbook file 800 named using a task name as shown in Fig. 16. In Fig. 16, since the Playbook is described in yaml format, the extension yaml is added, making it "Playbook_Destination.yaml". In addition, in the Playbook described in the Playbook file 800, a task name that is the same as the Ansible execution program file name is defined by a task name declaration statement 801. In Fig. 17, "Set_Destination" is defined as the task name.
[0104] Next, the method list is referenced, and if the method is in the list, the parameters to be passed to the Ansible execution program are described in the task parameter definition section 810 in the Playbook. The method, mandatory parameter list (when a mandatory parameter is in the mandatory parameter list), optional parameter list (when an optional parameter is in the optional list), configuration item identifier (when a configuration item identifier is in the configuration item identifier list), and address are specified in the task parameter definition section 810.
[0105] Furthermore, the program creation and execution device 100 creates an Ansible execution program file 900 named using a task name defined in a Playbook as shown in Fig. 17. In the example of Fig. 17, the file name is "Set_Destination.py" with the extension py indicating that it is written in the programming language Python.
[0106] The Ansible execution program written in the Ansible execution program file 900 includes a parameter declaration section 911 , a parameter assignment section 912 , a setting item assignment section 913 , a URL creation section 914 , a payload creation section 920 , and an HTTP message transmission section 921 .
[0107] Variables in the Ansible program function are declared in the parameter declaration section 911. When the playbook is executed, the value of each variable is assigned from the playbook in the parameter assignment section 912. When the playbook is executed, the value of the variable of the configuration item is assigned from the playbook in the configuration item assignment section 913.
[0108] A URL creation unit 914 creates a URL to which the HTTP message is to be sent, using the address, setting item name, and setting item identifier whose values have been set by the parameter assignment unit 912. A payload creation unit 920 creates a payload for the HTTP message, using the required parameter list and optional parameter list whose values have been set by the parameter assignment unit 912.
[0109] An HTTP message sending unit 921 specifies a URL and a payload (if the method has one) for each method, and sends an HTTP message.
[0110] Next, an example of a user interface screen provided by the program creation and execution device 100 will be described with reference to FIG. The program creation utility screen 1000 is a utility screen used by the network system operator 90 when creating and executing a Playbook and an Ansible execution program from a REST API.
[0111] The program creation utility screen 1000 is made up of a program creation designation area 1010 , a software configuration tree display area 1020 , and a software code display area 1030 .
[0112] The program creation specification area 1010 includes a threshold input list 1011 and a priority setting item input field 1012 .
[0113] The threshold value of the "setting item" or "method" specified by the list (the value of threshold 700b in threshold information data table 700 in FIG. 11) is input into threshold input list 1011. A character string representing a setting item is input into priority setting item input field 1012, and this means that a Playbook and an Ansible execution program are created for the setting item specified here ("ipsec" in the example of FIG. 18) regardless of the number of times it has been used (note that in S104 shown in FIG. 14, the target was a setting item whose number of times it has been used is equal to or greater than the threshold).
[0114] In the software configuration tree display area 1020, Playbooks and Ansible execution programs related to the communication path providing device 20 and the security providing device 30 that are the targets of network configuration are displayed in a tree format.
[0115] When a Playbook name or Ansible execution program name displayed in the software configuration tree display area 1020 is selected, the specific code is displayed in the software code display area 1030. By referring to these Playbooks and Ansible execution programs, program developers can reduce their development efforts.
[0116] As described above, according to the present embodiment, the network system operator 90 can automatically generate a Playbook and an Ansible execution program to be set for the communication path providing device 20 and the security providing device 30 based on the history information of the command including the REST API, and can use them to set and operate a plurality of communication path providing devices 20 and security providing devices 30. In addition, even when a product or service is added or the configuration of the product or service is changed, the cost of developing a new program or configuration file can be reduced. In addition, only commands including REST API whose method and network device setting items are equal to or greater than a threshold value within a certain period of time are targeted for the generation of a Playbook and an Ansible execution program, that is, only frequently used commands are targeted, so that a Playbook and an Ansible execution program are not generated for commands that are used less frequently, and pressure on the capacity of the storage device can be prevented. [Explanation of symbols]
[0117] 1...Internet, 3,5...LAN, 7...IPsec tunnel, 20: communication path providing device, 21: device control unit, 22: setting content receiving unit, 23: communication control unit, 24: storage unit, 30: security providing device, 31: device control unit, 32: setting content receiving unit, 33: communication control unit, 34: storage unit, 40...user terminal, 50…virtual terminals, 70: Threshold information data, 71: Execution history information data, 72: Analysis result information data, 73, 74: Device setting information data, 90...Operator, 100... program creation and execution device, 105... user interface unit, 110... program creation unit, 111... execution history information acquisition and analysis unit, 112... configuration file and execution code generation unit, 120... program execution unit, 130... storage unit, 300…bases, 400…Data center, 500...Shell environment, 800...Playbook file, 900...Ansible execution program file, 1000...Program creation utility screen
Claims
1. A program creation and execution device that creates a program based on a command including API (Application Programming Interface) information and executes the created program, Execution history information data of a method and a parameter of a command including the API information; Analysis result information data obtained by analyzing the execution history information data, A program creating and executing device which periodically creates a setting file and a program which realizes the same function as a command including the API information, based on the analysis result information data.
2. 2. The program creating and executing device according to claim 1, wherein the method is a method for setting a network device.
3. Further, the API information includes threshold information data for holding thresholds for items included in the API information, The program creation and execution device described in claim 2, characterized in that it counts the number of times an item included in the API information is used in a command including the API information within a certain period of time, compares the number of times the item included in the API information is used with a threshold for the item included in the API information in the threshold information data, and when the number of times the item included in the API information is used is equal to or greater than the threshold for that item, creates a configuration file and a program that realizes the same function as the command including the API information.
4. 4. The program creation and execution device according to claim 3, wherein the items included in the API information are methods or setting items of the network device.
5. The API is a Representational State Transfer Application Programming Interface (REST API), 2. The program creating and executing device according to claim 1, wherein the setting file is an Ansible Playbook, and the program is an Ansible execution program executed on Ansible.
6. 2. The program creating and executing device according to claim 1, wherein the method is an HTTP method.
7. A program creation and execution method for creating a program based on a command including REST API (Representational State Transfer Application Programming Interface) information by a program creation and execution device, and executing the created program, comprising: The program creation and execution device comprises: Execution history information data of HTTP methods and parameters of commands including the REST API information; Analysis result information data obtained by analyzing the execution history information data, The program creation and execution method includes a step of the program creation and execution device periodically creating, based on the analysis result information data, an Ansible Playbook that realizes the same function as a command including the REST API information, and an Ansible execution program that is executed on the Ansible.
8. 8. The program creating and executing method according to claim 7, wherein the HTTP method is a method for setting a network device.
9. The program creation and execution device further has threshold information data for holding thresholds for items included in the REST API information, 9. The program creation and execution method according to claim 8, characterized in that in the step of creating an Ansible Playbook and an Ansible execution program to be executed on the Ansible, the method counts the number of uses of an HTTP method or a setting item of the network device included in a command including the API information within a certain period of time, compares the number of uses of the HTTP method or the setting item of the network device with a threshold value for the HTTP method or the setting item of the network device in the threshold information data, and creates a setting file and a program that realize the same function as the command including the API information when the number of uses of the HTTP method or the setting item of the network device is equal to or greater than the threshold value for the HTTP method or the setting item of the network device in the threshold information data.
Citation Information
Patent Citations
System construction parameter management device, system construction parameter management system, system construction parameter management method, and system construction parameter management program
JP2020061019A
