Enterprise Edition OpenAPI
ログインインターフェース
| インターフェースアドレス | リクエスト方法 | content-type |
|---|
| /user/login | POST | application/x-www-form-urlencoded |
| パラメータ名 | 型 | 必須かどうか | 説明 |
|---|
| username | string | はい | ユーザー名 |
| password | string | はい | パスワード |
- ログインインターフェースにアクセスすると、token を取得できます。
- OpenAPI のすべてのリソース(ログインインターフェースを除く)へのアクセスには認証が必要です。
- 認証方法は、リクエストヘッダーに Authorization フィールドを含めることで行い、その値は token です。
データソースの作成
| インターフェースアドレス | リクエスト方法 | Content-Type |
|---|
| /datasource/add | POST | application/json |
json{
"note": "local",
"name": "local-mysql",
"detail": {
"type": "mysql",
"url": "jdbc:mysql://localhost:3306/test?useSSL=false&characterEncoding=UTF-8&serverTimezone=GMT%2B8",
"username": "root",
"password": "root",
"edit_password": true,
"driver": "com.mysql.cj.jdbc.Driver",
"druidProperties": "druid.testWhileIdle=true\ndruid.breakAfterAcquireFailure=true\ndruid.connectionErrorRetryAttempts=3",
"tableSql": "show tables"
},
"type": "jdbc"
}
データソースの削除
| インターフェースアドレス | リクエスト方法 | Content-Type |
|---|
| /datasource/delete/ | POST | application/x-www-form-urlencoded |
グループの作成
| インターフェースアドレス | リクエスト方法 | Content-Type |
|---|
| /group/create | POST | application/x-www-form-urlencoded |
| パラメータ名 | 型 | 必須かどうか | 説明 |
|---|
| name | string | はい | グループ名 |
グループの削除
| インターフェースアドレス | リクエスト方法 | Content-Type |
|---|
| /group/delete/ | POST | application/x-www-form-urlencoded |
API の作成
| インターフェースアドレス | リクエスト方法 | Content-Type |
|---|
| /apiConfig/add | POST | application/json |
json{
"note": "学生データの照会",
"cachePlugin": {
"pluginType": 1
},
"access": 1,
"paramsJson": [
{
"name": "id",
"type": "bigint",
"note": "学生ID"
}
],
"taskJson": [
{
"taskType": 1,
"sqlList": [
{
"sqlText": "select * from student where id = #{id}"
}
],
"transaction": 0,
"datasourceId": "5iaIut1Z"
}
],
"paramRules": [
{
"apiId": "J3z0SP59",
"script": "id > 0",
"type": "JavaScript",
"message": "idは正数でなければならない"
}
],
"groupId": "leqbGt5S",
"globalTransformPlugin": {
"pluginType": 3
},
"path": "student/all",
"name": "データ照会",
"alarmPlugins": [
{
"pluginType": 2
}
],
"transformScript": {
"type": "JavaScript"
},
"contentType": "application/x-www-form-urlencoded",
"jsonParam": "{}"
}
API の変更
| インターフェースアドレス | リクエスト方法 | Content-Type |
|---|
| /apiConfig/update | POST | application/json |
json{
"note": "学生データの照会",
"cachePlugin": {
"pluginType": 1,
"apiId": "J3z0SP59"
},
"access": 1,
"paramsJson": [
{
"note": "学生ID",
"name": "id",
"type": "bigint"
}
],
"taskJson": [
{
"taskType": 1,
"sqlList": [
{
"sqlText": "select * from student where id = #{id}"
}
],
"transaction": 0,
"datasourceId": "5iaIut1Z"
}
],
"paramRules": [
{
"id": 1,
"apiId": "J3z0SP59",
"script": "id > 0",
"type": "JavaScript",
"message": "idは正数でなければならない"
}
],
"groupId": "leqbGt5S",
"globalTransformPlugin": {
"pluginType": 3,
"apiId": "J3z0SP59"
},
"path": "student/all",
"name": "データ照会",
"alarmPlugins": [
{
"pluginType": 2,
"apiId": "J3z0SP59"
}
],
"transformScript": {
"apiId": "J3z0SP59",
"type": "JavaScript"
},
"id": "J3z0SP59",
"contentType": "application/x-www-form-urlencoded"
}
API の公開
| インターフェースアドレス | リクエスト方法 | Content-Type |
|---|
| /apiConfig/online/ | POST | application/x-www-form-urlencoded |
API の非公開
| インターフェースアドレス | リクエスト方法 | Content-Type |
|---|
| /apiConfig/offline/ | POST | application/x-www-form-urlencoded |