CN112486798A - Method and device for managing resource instances, implementation equipment and storage medium - Google Patents
Method and device for managing resource instances, implementation equipment and storage medium Download PDFInfo
- Publication number
- CN112486798A CN112486798A CN201910860728.4A CN201910860728A CN112486798A CN 112486798 A CN112486798 A CN 112486798A CN 201910860728 A CN201910860728 A CN 201910860728A CN 112486798 A CN112486798 A CN 112486798A
- Authority
- CN
- China
- Prior art keywords
- resource
- instance
- instances
- priority
- resource instances
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The invention provides a method, a device, an implementation device and a storage medium for managing resource instances, which comprise the following steps: creating a plurality of resource instances in a first example, and marking a priority on each resource instance, wherein the priority is used for orderly managing each resource instance; storing the plurality of resource instances into a resource saving summary table; and the resource saving summary table saves the plurality of resource instances by taking the first case ID as a key value. The invention can simply and conveniently realize the resource management in the automatic test process and improve the efficiency of the resource management.
Description
Technical Field
The invention relates to a resource management method, in particular to a resource instance management method.
Background
How to correctly and efficiently manage the operating environment in the automatic testing process becomes an important problem. Automated testing has no human intervention, but this feature also introduces some uncontrolled risk. A common method is to use a list method of a cloud platform to export all resource lists for management, and this processing method has many problems:
1. the management method cannot effectively distinguish which resources belong to automatic creation and which resources belong to manual creation;
2. the management method cannot acquire the association relationship between the resources, so that the resources are listed according to conditions and then managed, and a process error may be caused;
3. the management method needs to perform resource searching operation, increases the execution time of resource rollback and has low management efficiency.
The other way is to use the created resource instance, and when managing the resource, the complicated association relation needs to be recorded in the creation and updating processes of the resource, so as to improve the reliability and the safety of the automatic test.
Disclosure of Invention
The embodiment of the invention provides a method, a device, implementation equipment and a storage medium for managing a resource instance, which are used for at least solving the problems of complex resource instance management and low reliability and safety in the related technology.
According to an embodiment of the present invention, there is provided a method of managing resource instances, including: creating a plurality of resource instances in a first example, and marking a priority on each resource instance, wherein the priority is used for orderly managing each resource instance; storing the plurality of resource instances into a resource saving summary table; and the resource saving summary table saves the plurality of resource instances by taking the first case ID as a key value.
According to another embodiment of the present invention, there is provided an apparatus for managing resource instances, including: a creation module that creates a plurality of resource instances in a first instance and marks a priority on each resource instance; the priority is used for managing each resource instance in order; the recording module is used for storing the plurality of resource instances into a resource saving summary table; and the resource saving summary table saves the plurality of resource instances by taking the first case ID as a key value.
According to another embodiment of the present invention, an implementation apparatus for a method of managing resource instances is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and is characterized in that the processor implements the implementation method of the resource instance management when executing the program.
According to another embodiment of the present invention, a computer-readable storage medium is provided, which stores computer-executable instructions for performing the implementation method of resource instance management.
According to the invention, when the resource instance is created in the use case, each resource instance is given a label, and the corresponding relation between the use case ID and the resource instance is established in the resource summary table, so that the invention can establish a relatively clear sequence relation of the resource instance, is convenient for subsequent management, and also provides an application effect in an automatic test.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow diagram of a method of managing resource instances in accordance with an embodiment of the present invention;
FIG. 2 is a schematic illustration of resource instance priorities according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a resource holding summary table according to an embodiment of the invention;
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example one
As shown in fig. 1, an embodiment of the present invention provides a method for managing a resource instance, where the method includes the following steps:
step S101, a plurality of resource instances are created in a first example, and each resource instance is marked with a priority, and the priority is used for orderly managing each resource instance;
in step S101, the use case is used for automated testing in a virtualization environment, where the use case includes a plurality of resource instances, such as a plurality of virtual resource categories of users, networks, subnets, ports, virtual machines, security groups, and the like, and the resources have an intricate and complex relationship with each other, which is important in how to manage the resources in an automated testing scenario.
The invention provides a resource instance priority table, wherein the index in the table is the class name of the corresponding resource instance in the execution software, the numerical value is the priority of the resource instance, and the use mode of the table is as follows: the management method provides a corresponding class for each virtual resource (equivalent to a resource instance) on the platform, and the resource instances stored in the software are all instantiated resource instances by the classes corresponding to the resources. The resource instance has a null priority attribute in addition to its own attribute. When the action of creating the resource instances is executed, the creating action triggers a capturing mechanism of the software to capture the generated instances, the software searches a resource instance priority list to give priority to the resource instances after capturing the instances, and the resource instances with the priority are finally pushed into a storage queue and sorted.
Step S102, storing a plurality of resource instances into a resource saving summary table; and the resource saving summary table saves a plurality of resource instances by taking the first case ID as a key value.
In step S102, when a resource instance is created, it is immediately stored in a resource saving summary table, where the resource saving summary table is a resource management structure, and all resource instances created in a use case are sequentially saved with the ID of the use case as an index (equivalent to a key value).
As shown in fig. 3, each resource instance in the corresponding use case is stored in the resource management summary table with the use case ID as a key value.
Further, the priority of each resource instance is marked according to the type of each resource instance. As shown in fig. 2, various resource instances are marked with priorities, for example, the tenant instance has a priority of 0; the priority of the network instance is 20; the priority of the qos policy QoSPolicy instance is 40, and the priority is not limited herein and can be adjusted as needed.
Further, when the state mark of the first use case is deleted, the resource saving general table is accessed, and the plurality of resource instances are deleted from high to low in sequence according to the priority level of each resource instance. When the use case status flag with the use case ID of 1 is deleted, the resource saving general table is accessed according to ID1, and according to the priority of the resource instance therein, the resource instance is sequentially deleted, for example, the priority of the QoSPolicy instance is 40, the priority of the network instance is 20, and the priority of the tenant instance is 0.
Further, in case the second instance needs to create a resource instance; and accessing the resource storage general table according to the case ID, and traversing the resource instances of the resource storage general table until the resource instances meeting the requirements of the second case are obtained. The second embodiment calls the embodiment to obtain the interface object _ get, has appointed use case id and embodiment type; accessing a resource storage general table, accessing the resource storage general table according to the use case id, traversing the instances in sequence, filtering the instances according to the instance types until the instances conforming to the second use case are obtained, and returning the instances as the return value of the object _ get; the use case can use the return value of the object _ get as a resource created by the second use case until the execution of the use case is finished.
When creating the second use case, the second use case calls the object _ get without recreating all new resource instances therein, and can specify the ID of the first use case and the type of the instances; and then accessing the resource storage general table, accessing the general table according to the ID of the first use case, filtering according to requirements, acquiring the instances required by the second use case, returning the return value serving as the object _ get, and enabling the acquired resources to be equal to the self-created resource instances of the second use case. Therefore, the step of recreating all resource instances when the instances are newly built is omitted.
Further, when multiple resource instances are deleted, the resource instances on all the related devices are deleted. The invention is used for automatic testing, wherein various devices are involved, and network devices and user devices are possible. When the resource instance is deleted, all the related resource instances of all the test related devices are deleted.
Further, when the plurality of resource instances are deleted, the data structures of the plurality of resource instances are used as entries, and a uniform deletion interface is called to delete the plurality of resource instances. When the deleting operation is executed, the unification of the resource deleting interfaces refers to the uniqueness of calling interfaces when the resources are deleted. When the resource instance deleting action is carried out, the method can take out the residual resources one by one according to the resource saving summary table of the figure 3 and transmit the residual resources as the access parameters to the resource deleting interface, and the resource deleting interface is a function which takes the resource instance to be deleted as the only access parameters. The native Openstack restconf or other resource deletion interfaces usually do not use the resource to be deleted as the only entry, the user deletion resource usually provides the instance id and the associated resource as the auxiliary parameter, and the entry and the participation of the deletion interfaces are unified in order to realize the deletion automation. The basic principle of the integration is resource association record, when the resource is created or updated, the invention can constantly record the association relation change related to the interface deletion, constantly record and update the association relation, and use the association relation as an attribute of the resource instance. When the delete interface is called, other auxiliary entries required by the native interface will be fetched from the incoming to-be-deleted instance attribute. And after finishing unifying the input parameters of the deleting interface, calling the deleting interface to delete. The invention realizes the function entry unification of the resource deletion calling interface, namely in a unified resource instance deletion method ins _ delete (instance), distinguishing according to the type of the deletion instance, and respectively calling the respective deletion method, thereby realizing the uniqueness of the resource calling interface.
By the method provided by the embodiment of the invention, the efficiency of resource instance management is improved by establishing the ordered resource instance storage method, the uniform interface can be called when the resource instance is deleted, and the efficiency of automatic testing is integrally improved.
Example two
The embodiment of the invention also provides a method for managing the resource instance, which comprises the following steps:
step S201, the automatic framework is executed to a case execution part, and the case starts to create resources;
step S202, using a case to call an interface tend _ add of a created tenant, and capturing a return value tend _ obj of the interface;
step S203, the automation framework takes the Tenant resource instance, judges the type of the Tenant instance to be Tenant, searches a resource priority table by taking the Tenant as an index, takes the priority of the Tenant resource (the priority is positioned to be 0), and stores the priority into the attribute priority of the Tenant;
step S204, inserting the tenant instances into a temporary list tmp _ instance _ list in order;
step S205, a single resource maintenance action is completed, a network interface network _ add is created by using a case call, and a return value net _ obj of the interface is captured;
step S206, the automation framework obtains the Network resource instance, judges the instance type to be Network, searches a resource priority table by taking the Network as an index, obtains the Network resource priority to be 20, and stores the Network resource priority to the property priority of the tenant;
step S207, orderly inserting the network resource instances into the temporary list in the step S204;
step S208, creating resource instances such as a subnet instance, a virtual machine instance and the like as the steps, calling a service test interface to complete the execution of the case, and similarly, removing the resource from the tmp _ instance _ list in time when the resource deleting interface is executed;
step S209, taking the list tmp _ instance _ list as a value and taking the use case id as a key, and saving the resource instance just recorded to a resource saving summary table according to the structure;
step S210, if the use case status flag is deleted, execute step S211; if the use case status flag is not deleted, step S212 is executed.
Step S211, accessing a resource saving general table, taking out a residual resource list pointing to a use case as required, traversing the list in sequence, wherein the list can preferentially take out resources with high priority, then taking the currently traversed example as a reference to call a uniform deletion interface (ins _ delete) (instance), wherein the frame captures the resource deletion interface to be executed, acquiring the reference instance, and maintaining and removing the reference instance from the general table;
in step S212, the second use case calls the instance obtaining interface object _ get, and specifies the use case id, the name, and the instance type. And accessing a resource storage general table, accessing the specified residual resource list according to the use case id, traversing the instances in sequence, filtering the instances according to the names and the instance types until the instances meeting the expectation of the user are obtained, and returning a return value serving as an object _ get function. The return value of object _ get can be used as a resource for the second use case creation.
EXAMPLE III
The embodiment of the invention also provides a device for managing the resource instance, which comprises the following modules:
a creation module that creates a plurality of resource instances in a first instance and marks a priority on each resource instance; the priority is used for managing each resource instance in order;
the recording module is used for storing the plurality of resource instances into a resource saving summary table; and the resource saving summary table saves the plurality of resource instances by taking the first case ID as a key value.
Further, the device also comprises a deleting module: the resource saving summary table is used for accessing the resource saving summary table, and when the mark of the first use case is deleted, the plurality of resource instances are deleted from high to low in sequence according to the priority of each resource instance; or, when the first instance is marked as reserved, the resource instance is not deleted.
Example four
The embodiment of the present invention further provides a device for implementing resource instance management, including: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements a method of resource instance management when executing the program.
EXAMPLE five
The embodiment of the invention also discloses a computer-readable storage medium, which stores computer-executable instructions, wherein the computer-executable instructions are used for executing the implementation method of resource instance management.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A method of managing resource instances, comprising:
creating a plurality of resource instances in a first example, and marking a priority on each resource instance, wherein the priority is used for orderly managing each resource instance;
storing the plurality of resource instances into a resource saving summary table; and the resource saving summary table saves the plurality of resource instances by taking the first case ID as a key value.
2. The method of claim 1, creating the resource instance in a first use case and marking a priority on the resource instance, comprising:
marking the priority of each resource instance according to the type of each resource instance.
3. The method of claim 1 or 2, further comprising:
and when the state of the first use case is marked as deletion, accessing the resource storage general table, and deleting the plurality of resource instances from high to low in sequence according to the priority of each resource instance.
4. The method of claim 1, further comprising:
in the case that the second instance requires creation of a resource instance;
and accessing the resource storage general table according to the use case ID, and traversing the resource instances of the resource storage general table until the resource instances meeting the requirements of the second use case are obtained.
5. The method of claim 3, comprising:
when the plurality of resource instances are deleted, the resource instances on all the related devices are deleted.
6. The method of claim 3, deleting the plurality of resource instances in order from high to low, comprising:
and when the plurality of resource instances are deleted, taking the data structures of the plurality of resource instances as the access parameters, and calling a uniform deletion interface to delete the plurality of resource instances.
7. An apparatus that manages instances of resources, comprising:
a creation module that creates a plurality of resource instances in a first instance and marks a priority on each resource instance; the priority is used for managing each resource instance in order;
the recording module is used for storing the plurality of resource instances into a resource saving summary table; and the resource saving summary table saves the plurality of resource instances by taking the first case ID as a key value.
8. The apparatus of claim 7, comprising:
a deleting module, configured to access the resource saving summary table, and when the first use case is marked as deleted, sequentially delete the plurality of resource instances from high to low according to the priority of each resource instance;
or, when the first instance is marked as reserved, the resource instance is not deleted.
9. An implementation device for resource instance management, comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements a method for resource instance management according to any of claims 1 to 6 when executing the program.
10. A computer-readable storage medium storing computer-executable instructions for performing an implementation method of resource instance management according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910860728.4A CN112486798A (en) | 2019-09-11 | 2019-09-11 | Method and device for managing resource instances, implementation equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910860728.4A CN112486798A (en) | 2019-09-11 | 2019-09-11 | Method and device for managing resource instances, implementation equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112486798A true CN112486798A (en) | 2021-03-12 |
Family
ID=74920688
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910860728.4A Pending CN112486798A (en) | 2019-09-11 | 2019-09-11 | Method and device for managing resource instances, implementation equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112486798A (en) |
-
2019
- 2019-09-11 CN CN201910860728.4A patent/CN112486798A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111371627B (en) | Method for setting multiple IPs (Internet protocol) in Kubernetes through Pod | |
US5732257A (en) | Object conversion method from a flat object space to a class structured space | |
CN115292026B (en) | Management method, device and equipment of container cluster and computer readable storage medium | |
CN105429776B (en) | Method and system for managing functions of virtual network | |
EP2477355B1 (en) | Method and device for managing association of network resources | |
US20180024852A1 (en) | Virtualization management/orchestration apparatus, virtualization management/orchestration method, and program | |
JPH11252209A (en) | Network management system | |
CN110968509B (en) | Method and system for batch customizing of variables | |
CN108762949A (en) | Centralized dispatching method, system, computer equipment and storage medium | |
CN104506669B (en) | The IP address distribution system and method for a kind of Based on Distributed network simulation platform | |
CN112532761B (en) | Management method and device for automatically reporting and recording public network address | |
CN114064213A (en) | Kubernets container environment-based rapid arranging service method and system | |
US20230342183A1 (en) | Management method and apparatus for container cluster | |
CN115309498A (en) | Container state adjusting method, device, equipment and storage medium for K8s cluster | |
US20100218202A1 (en) | Method and Apparatus for Case-Based Service Composition | |
CN112905306A (en) | Multi-cluster container management method and device, electronic equipment and storage medium | |
US10491674B2 (en) | Network topology templates for internal states of management and control planes | |
CN113065801A (en) | Organization architecture management method, device, equipment and storage medium | |
CN112529711A (en) | Transaction processing method and device based on block chain virtual machine multiplexing | |
CN111857955A (en) | Method for automatically constructing and updating resource configuration information in heterogeneous cloud environment | |
CN112486798A (en) | Method and device for managing resource instances, implementation equipment and storage medium | |
CN111045928A (en) | Interface data testing method, device, terminal and storage medium | |
CN115686497A (en) | Business development data management method, development engine, electronic device, and storage medium | |
US20090293064A1 (en) | Synchronizing shared resources in an order processing environment using a synchronization component | |
CN112380411A (en) | Sensitive word processing method and device, electronic equipment, system and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20210312 |
|
WD01 | Invention patent application deemed withdrawn after publication |