当前位置:网站首页>Chapter 2 using API Mgmnt service
Chapter 2 using API Mgmnt service
2022-07-24 16:16:00 【yaoxin521123】
List of articles
Chapter two Use /api/mgmnt/ service
This chapter describes how to use /api/mgmnt Services to create 、 Update and delete REST service .
/api/mgmnt The service also provides services that can be used to discover and record Web Service options , As described later in this book .
Use /api/mgmnt Service creation REST service
establish REST The service recommendation method is REST Service creation OpenAPI 2.0( Also known as Swagger) describe , And use it to generate REST Service . If you are implementing REST service , They may provide this OpenAPI 2.0 describe . of OpenAPI 2.0 Describe the details of the format , see also OpenAPI 2.0 standard . The following topics describe how to use /api/mgmnt Service to perform this operation .
Use /api/mgmnt Service generation class
First step , Generate REST Service , As shown below :
- With
JSONFormat creation or acquisitionRESTServiceOpenAPI 2.0describe . - obtain
RESTTesting tools , for examplePostMan(https://www.getpostman.com/). - In the test tool , Create as follows
HTTPThe request message :
- about
HTTPoperation , Select or specifyPOST. - about
URL, Please specify the following formURL:
http://localhost:52773/api/mgmnt/v2/namespace/myapp
among localhost Is the name of the server ,52773 Is to run IRIS Of Web Server port ,namespace Is to create REST The name space of the service ,myapp Is the name of the package in which the class is to be created .
- For request body , With
JSONFormat pasteWebServiceOpenAPI 2.0describe . - Specify the request body type as
JSON(application/json) - by
IRISUsernameandIRISPasswordParameters provide values . aboutIRISUsername, Specify a user , The user is%DeveloperMembers of the role , And have read to the given namespace / Write access .
- Send request message .
If the call succeeds , IRIS Create in a given package and namespace disp、impl and spec class .
- In the test tool , Check the response message . If the request succeeds , The response message will be similar to the following example :
{
"msg": "New application myapp created"
}
To complete the basic REST service , Please create a Web Application and define the implementation . These steps can be performed in any order .
establish Web Applications
In this step , A provider will be created to REST Service access Web Applications . In the management portal , Complete the following steps :
- single click
System Administration > Security > Applications > Web Applications. - Click create new
WebApplications . - Specify the following values :
Name—WebName of the application ; This is in thisIRISMust be unique in the instance . The most common names are based on runningWebThe namespace of the application :/csp/namespaceNamespace- Select the namespace in which the class is generated .- Enable application
Enable Application— Select this check box . - Enable
Enable— choiceREST. - Scheduling class
Dispatch Class— Type the fully qualified name of the scheduling class . This should always bepackage.disp, amongpackageIs the name of the package containing the generated class .
- Click save .
Use /api/mgmnt Service update REST service
API Management tools enable you to update generated classes , Without changing the edits made in the implementation class . If necessary, , This class will be regenerated , But keep editing .
To update REST service , Please use “ Use /api/mgmnt Service generation class ” The steps listed in .
If the update is successful ,IRIS Will regenerate disp and spec Class and update impl class , Keep the edits made to this class . The response message will be similar to the following example :
{
"msg": "Application myapp updated"
}
How to update the implementation class
If you have edited impl class , These edits will be retained , As shown below :
- The implementation of all methods remains the same .
- Any new class members added will remain intact .
however , The class and the description of each generated method will be regenerated (/// notes ). If the signature of any implementation method changes ( for example , Because the specification has changed ), The signature is updated and the following comments are added to the class method :
/// WARNING: This method's signature has changed.
Use /api/mgmnt Service deletion REST service
API Management tools also make it easy to delete REST service . So :
- Use
RESTTesting tools , establishHTTPThe request message , As shown below :
- about
HTTPoperation , Select or specifyDELETE. - about
URL, Please specify the following formURL:
http://localhost:52773/api/mgmnt/v2/namespace/myapp
among localhost Is the name of the server ,52773 Is to run IRIS Of Web Server port ,namespace Is to create REST The name space of the service ,myapp Is included REST The name of the package of the service class .
- by
IRISUsernameandIRISPasswordParameters provide values . aboutIRISUsername, Specify a user , The user is%DeveloperMembers of the role , And have read to the given namespace / Write access .
- Send request message .
If the call succeeds ,IRIS Will delete... In the given package and namespace disp and spec class .
however , IRIS Does not delete impl class .
- In the test tool , Check the response message . If the request succeeds , The response message will be similar to the following example :
{
"msg": "Application myapp deleted"
}
- Manually delete the implementation class .
To be on the safe side ,/api/mgmnt The service will not automatically delete the implementation class , Because this class may contain a lot of customization .
- This is before deletion
RESTCreated by serviceWebApplications ( If there is ). So :
a. In the management portal , single click System Administration > Security > Applications > Web Applications.
b. On the list Web Click delete... In the row of the application .
c. Click OK to confirm the deletion .
边栏推荐
- Solution to deepin taskbar disappearance
- C TCP client form application asynchronous receiving mode
- Simplified understanding: publish and subscribe
- 狗牙根植物介绍
- Fine tune layoutlm V3 for bill data processing and content recognition
- [tf.keras]: a problem encountered in upgrading the version from 1.x to 2.x: invalidargumenterror: cannot assign a device for operation embedding_
- Yolov4 trains its own data set
- Servlet框架(servlet+jsp)+Mysql实现的增删改查+分页(功能包学生信息录入、学生信息增删改查、分页等)
- 公钥私钥传输,以及对CA证书的理解
- [loj3247] [USACO 2020.1 platinum "non declining subsequences (DP, divide and conquer)
猜你喜欢

Hard core innovation that database needs to care about in the future

iptables常用命令小清单
![Leetcode:162. looking for peak [two points looking for peak]](/img/77/64b7c9bf1aebc2a0ab82218ddfff62.png)
Leetcode:162. looking for peak [two points looking for peak]

There are more than 20 categories of the four operators in MySQL. It took three days and three nights to sort them out. Don't collect them quickly

How to generate complex flow chart of XMIND

Introduction to kettle messy notes

Which is a good noise reduction Bluetooth headset? Ranking of the most cost-effective noise reduction Bluetooth headsets

有了这个机器学习画图神器,论文、博客都可以事半功倍了!

LaneATT

Dynamics crm: mailbox configuration (III) - configure email server profiles and mailboxes
随机推荐
Leetcode 220. duplicate element III exists
Yolov4 trains its own data set
Which is a good noise reduction Bluetooth headset? Ranking of the most cost-effective noise reduction Bluetooth headsets
Public and private key transmission, and understanding of CA certificate
Solution to deepin taskbar disappearance
Dynamics 365: how to get the authentication information required to connect to D365 online from azure
3、 Set foundation ArrayList set and simple student management system
Scala functions and their higher-order applications
Mysql8 encountered the problem of stopping after the service was started
Talk about C pointer
Research on the efficiency of numpy array access
Memcache cache application (lnmp+memcache)
31 next spread
如何防止跨站点脚本 (XSS) 攻击完整指南
狗牙根植物介绍
105 constructing binary trees from preorder and inorder traversal sequences
REST风格
Software recommendation - Mechanical Major
Array in PHP_ The pit of merge
Small list of iptables common commands