接口设计

MEP 接口简介

MEP主要包含MEP-server和MEP-auth两个主要功能模块。MEP server接口分为两类,一类为遵循ETSI MEC 011 v2.1.1标准的Mp1接口,主要为App提供服务注册发现,App状态通知订阅,Dns规则获取等功能;另一类为Mm5接口,主要为MECM/MEPM提供配置管理功能。MEP auth目前主要作为鉴权模块,为App提供token申请发放功能。URL为服务自己的URL,PORT为服务自己的PORT。如果经过KONG,PORT变成KONG的PORT,URL需要添加对应的路由。mepauth直接添加{KONG_MEPAUTH_ROUTE}(当前值为/mepauth),mepserver把/mep用{KONG_MEPSERVER_ROUTE}(当前值为/mepserver)替换。

MEP-auth模块接口

服务认证接口

应用通过AK/SK向LDVS进行鉴权认证,认证通过后返回token,每个token具有有效期(1小时),token分配方在有效期结束后将收回token,当携带过期的token的HTTP请求到达的时候,将被以状态码401返回;此时token携带方需要重新进行token获取。当token还在有效期内,token携带方再次使用相同的用户获取token时返回当前仍然有效的token。

URL:

POST /mepauth/v1/token

请求参数:

名称 类型 描述 IN 必选
Content-Type String MIME类型, 填"application/json" header
Authorization String 认证信息 header
x-sdk-date String 签名时间(当前时间戳,格式:YYYYMMDDTHHMMSSZ) header
Host String 与生成认证信息签名用到的host字段保持一致 header

Body参数:

请求示例:

POST /mepauth/v1/token

{
  "header": [
    {
      "key": "Content-Type",
      "value": "application/json"
    },
    {
      "key": "Authorization",
      "value": "SDK-HMAC-SHA256 Access= QVUJMSUMgS0VZLS0tLS0=,
      SignedHeaders=content-type;host;x-sdk-date,
      Signature=142b0dc3feaeb3662b2033a8e6425596546e08a231aa39179b4060867dd15d3d"
    },
    {
      "key": "x-sdk-date",
      "value": "20060102T150405Z"
    },
    {
      "key":"Host",
      "value":"xxx"
    }
  ]
}

返回参数:

返回码:200

OK

名称 类型 描述 必选
access_token String Token
token_type String Token类型(Bearer)
expires_in int 失效时间

返回示例:

HTTP/1.1 200 OK
{
	"access_token":"xxxx",
	"token_type":"Bearer",
	"expires_in":"3600"
}

注:在测试时,请确保启动EG-LDVS时使用的AK/SK和获取token时使用的AK/SK相同。基于AK/SK的认证,EG-LDVS对于相同的AK若5分钟内三次认证失败,对应AK将被锁定15分钟。

AK/SK配置接口

URL:

PUT /mepauth/v1/applications/{appInstanceId}/confs

请求参数:

名称 类型 描述 IN 必选
Content-Type String MIME类型,填"application/json" header
appInstanceId String APP实例ID(UUID) path

Body参数:

名称 类型 描述 必选
authInfo Object 用户信息
>credentials Object 证书信息
>>accessKeyId String AK
>>secretKey String SK

请求示例:

PUT /mepauth/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/confs
{
    "header": [
        {
            "key": "Content-Type",
            "value": "application/json"
        }
    ],
    "body": {
        "authInfo": {
            "credentials": {
                "accessKeyId": "QVUJMSUMgS0VZLS0tLS0",
                "secretKey": "DXPb4sqElKhcHe07Kw5uorayETwId1JOjjOIRomRs5wyszoCR5R7AtVa28KT3lSc"
            }
        }
    }
}

返回参数:

返回码:200

OK

名称 类型 描述 必选
authInfo Object 用户信息
>credentials Object 证书信息
>>accessKeyId String AK
>>secretKey String SK

返回示例:

HTTP/1.1 200 OK
{
    "authInfo": {
        "credentials": {
            "accessKeyId": "QVUJMSUMgS0VZLS0tLS0",
            "secretKey": "DXPb4sqElKhcHe07Kw5uorayETwId1JOjjOIRomRs5wyszoCR5R7AtVa28KT3lSc"
        }
    }
}

MEP-server 接口

应用服务管理相关接口

1. 查询应用服务

查询指定APP的服务列表

URL

GET /mep/mec_service_mgmt/v1/applications/{appInstanceId}/services

请求参数:

名称 类型 描述 IN 必选
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path

Body参数:

请求示例:

GET /mep/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/services
{
  "header": [
    {
      "key": "Authorization",
      "value": "Bearer xxx"
    }
  ]
}

返回参数:

返回码:200

OK

名称 类型 描述 必选
serInstanceId String 服务实例ID
serName String 服务名称
serCategory Object 服务类别
>href String 目录参考
>id String 类别ID
>name String 类别名称
>version String 类别版本号
version String 服务版本号
state String 服务状态(ACTIVE/INACTIVE)
transportInfo Object 服务信息
>id String ID
>name String 名称
> description String 描述
> type String 类型(REST_HTTP/MB_TOPIC_BASED/MB_ROUTING/MB_PUBSUB/RPC/RPC_STREAMING/WEBSOCKET)
> protocol String 协议名称
> version String 版本号
> endpoint Ojbect Endpoint,三种信息其中的一个(uris/addresses/alternative)
>>uris Array[String] URI格式的服务入口信息列表
>>addresses Array[Object] 服务入口信息地址列表(IP地址+端口号)
>>>host String IP地址
>>>port String 端口号
>>alternative String 已实现格式或者外部规范定义的服务入口信息
> security Object 安全信息
>> oAuth2Info Object OAuth2.0参数
>>> grantTypes Array[String] 准予类型(OAUTH2_AUTHORIZATION_CODE/OAUTH2_IMPLICIT_GRANT/OAUTH2_RESOURCE_OWNER/OAUTH2_CLIENT_CREDENTIALS)
>>> tokenEndpoint String Token endpoint
> implSpecificInfo String 其他实现信息
serializer String 序列化类型(JSON/XML/PROTOBUF3)
scopeOfLocality String 地域范围(MEC_SYSTEM/MEC_HOST/NFVI_POP/ZONE/ZONE_GROUP/NFVI_NODE),默认值MEC_HOST
consumedLocalOnly boolean 是否只被本地域APP消费(true/false)
isLocal boolean 是否在本地域(true/false)
livenessInterval integer Interval (in seconds) between two consecutive heartbeat messages
_links Object Links to resources related to this resource. Shall be absent in HTTP requests.
>self object Link to this resource. Shall be present in HTTP responses.
>>liveness string Link to the resource where the MEC platform expects the service instance to send the liveness information.

返回示例:

HTTP/1.1 200 OK
{
[
  {
    "serInstanceId": "0bc92b06cc213d2ad8beda71bd0e1460",
    "serName": "ExampleService",
    "serCategory": {
      "href": "/example/catalogue1",
      "id": "id12345",
      "name": "RNI",
      "version": "version1"
    },
    "version": "ServiceVersion1",
    "state": "ACTIVE",
    "transportInfo": {
      "id": "TransId12345",
      "name": "REST",
      "description": "REST API",
      "type": "REST_HTTP",
      "protocol": "HTTP",
      "version": "2.0",
      "endpoint": {},
      "security": {
        "oAuth2Info": {
          "grantTypes": [
            "OAUTH2_CLIENT_CREDENTIALS"
          ],
          "tokenEndpoint": "/mecSerMgmtApi/security/TokenEndPoint"
        }
      },
      "implSpecificInfo": {}
    },
    "serializer": "JSON",
    "scopeOfLocality": "MEC_SYSTEM",
    "consumedLocalOnly": false,
    "isLocal": true,
    "livenessInterval": 60,
    "_links": {
      "self": {
        "liveness" : "/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/service/0bc92b06cc213d2ad8beda71bd0e1460/liveness"
      }
    }
  }
]
}

2. 查询应用指定服务

查询对应APP的指定服务

URL

GET /mep/mec_service_mgmt/v1/applications/{appInstanceId}/services/{serviceId}

请求参数:

名称 类型 描述 IN 必选
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path
serviceId String APP服务实例ID path

Body参数:

请求示例:

GET /mep/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/services/0bc92b06cc213d2ad8beda71bd0e1460
{
  "header": [
    {
      "key": "Authorization",
      "value": "Bearer xxx"
    }
  ]
}

返回参数:

返回码:200

OK

名称 类型 描述 必选
serInstanceId String 服务实例ID
serName String 服务名称
serCategory Object 服务类别
>href String 目录参考
>id String 类别ID
>name String 类别名称
>version String 类别版本号
version String 服务版本号
state String 服务状态(ACTIVE/INACTIVE)
transportInfo Object 服务信息
>id String ID
>name String 名称
> description String 描述
> type String 类型(REST_HTTP/MB_TOPIC_BASED/MB_ROUTING/MB_PUBSUB/RPC/RPC_STREAMING/WEBSOCKET)
> protocol String 协议名称
> version String 版本号
> endpoint Ojbect Endpoint,三种信息其中的一个(uris/addresses/alternative)
>>uris Array[String] URI格式的服务入口信息列表
>>addresses Array[Object] 服务入口信息地址列表(IP地址+端口号)
>>>host String IP地址
>>>port String 端口号
>>alternative String 已实现格式或者外部规范定义的服务入口信息
> security Object 安全信息
>> oAuth2Info Object OAuth2.0参数
>>> grantTypes Array[String] 准予类型(OAUTH2_AUTHORIZATION_CODE/OAUTH2_IMPLICIT_GRANT/OAUTH2_RESOURCE_OWNER/OAUTH2_CLIENT_CREDENTIALS)
>>> tokenEndpoint String Token endpoint
> implSpecificInfo String 其他实现信息
serializer String 序列化类型(JSON/XML/PROTOBUF3)
scopeOfLocality String 地域范围(MEC_SYSTEM/MEC_HOST/NFVI_POP/ZONE/ZONE_GROUP/NFVI_NODE),默认值MEC_HOST
consumedLocalOnly boolean 是否只被本地域APP消费(true/false)
isLocal boolean 是否在本地域(true/false)
livenessInterval integer Interval (in seconds) between two consecutive heartbeat messages
_links Object Links to resources related to this resource. Shall be absent in HTTP requests.
>self object Link to this resource. Shall be present in HTTP responses.
>>liveness string Link to the resource where the MEC platform expects the service instance to send the liveness information.

返回示例:

HTTP/1.1 200 OK
{
 "serInstanceId": "0bc92b06cc213d2ad8beda71bd0e1460",
 "serName": "ExampleService",
 "serCategory": {
      "href": "/example/catalogue1",
      "id": "id12345",
      "name": "RNI",
      "version": "version1"
 },
 "version": "ServiceVersion1",
 "state": "ACTIVE",
 "transportInfo": {
   "id": "TransId12345",
   "name": "REST",
   "description": "REST API",
   "type": "REST_HTTP",
   "protocol": "HTTP",
   "version": "2.0",
   "endpoint": {},
   "security": {
        "oAuth2Info": {
          "grantTypes": [
            "OAUTH2_CLIENT_CREDENTIALS"
          ],
          "tokenEndpoint": "/mecSerMgmtApi/security/TokenEndPoint"
        }
      },
      "implSpecificInfo": {}
    },
    "serializer": "JSON",
    "scopeOfLocality": "MEC_SYSTEM",
    "consumedLocalOnly": false,
    "isLocal": true,
    "livenessInterval": 60,
    "_links": {
      "self": {
        "liveness" : "/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/service/0bc92b06cc213d2ad8beda71bd0e1460/liveness"
      }
    }
 }

3. 注册应用服务

为指定APP注册服务。

URL

POST /mep/mec_service_mgmt/v1/applications/{appInstanceId}/services

请求参数:

名称 类型 描述 IN 必选
Content-Type String MIME类型,填"application/json" header
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path

Body参数:

名称 类型 描述 必选
serName String 服务名称(字母/数字/_/-的组合,但不能以_和-开头或结尾),最大长度128
serCategory Object 服务类别
>href String 目录参考
>id String 类别ID,字母与数字组合,最大长度64
>name String 类别名称
>version String 类别版本号
version String 服务版本号(格式为x[.y[.z]],xyz取值范围0\~32767,例如:1;1.2;1.2.3)
state String 服务状态(ACTIVE/INACTIVE)
transportId String 服务信息ID,字母与数字组合,最大长度64
transportInfo Object 服务信息
>id String ID,字母与数字组合,最大长度64
>name String 名称(字母/数字/_/-的组合,但不能以_和-开头或结尾),最大长度128
> description String 描述,最大长度128
> type String 类型(REST_HTTP/MB_TOPIC_BASED/MB_ROUTING/MB_PUBSUB/RPC/RPC_STREAMING/WEBSOCKET)
> protocol String 协议名称,最大长度32
> version String 版本号
> endpoint Object Endpoint,三种信息其中的一个(uris/addresses/alternative)
>>uris Array[String] URI格式的服务入口信息列表
>>addresses Array[Object] 服务入口信息地址列表(IP地址+端口号)
>>>host String IP地址。例如:192.168.0.1
>>>port String 端口号(<=65535)。例如:8080
>>alternative String 已实现格式或者外部规范定义的服务入口信息
> security Object 安全信息
>> oAuth2Info Object OAuth2.0参数
>>> grantTypes String 准予类型(OAUTH2_AUTHORIZATION_CODE/OAUTH2_IMPLICIT_GRANT/OAUTH2_RESOURCE_OWNER/OAUTH2_CLIENT_CREDENTIALS)
>>> tokenEndpoint String Token endpoint
> implSpecificInfo String 其他实现信息
serializer String 序列化类型(JSON/XML/PROTOBUF3)
scopeOfLocality String 地域范围(MEC_SYSTEM/MEC_HOST/NFVI_POP/ZONE/ZONE_GROUP/NFVI_NODE),默认值MEC_HOST
consumedLocalOnly boolean 是否只被本地域APP消费(true/false)
isLocal boolean 是否在本地域(true/false)
livenessInterval integer Interval (in seconds) between two consecutive heartbeat messages

请求示例:

POST /mep/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/services
{
  "header": [
    {
      "key": "Content-Type",
      "value": "application/json",
      "key": "Authorization",
      "value": "Bearer xxx"
    }
  ],
  "body": {
    "serName": "FaceRegService",
    "serCategory": {
    "href": "/example/catalogue1",
    "id": "id12345",
    "name": "RNI",
    "version": "1.2.4"
    },
    "version": "4.5.7",
    "state": "ACTIVE",
    "transportId": "Rest1",
    "transportInfo": {
    "id": "TransId12345",
    "name": "REST",
    "description": "REST API",
    "type": "REST_HTTP",
    "protocol": "HTTP",
    "version": "2.0",
    "endpoint": {},
    "security": {
      "oAuth2Info": {
            "grantTypes": [
            "OAUTH2_CLIENT_CREDENTIALS"
            ],
            "tokenEndpoint": "/mecSerMgmtApi/security/TokenEndPoint"
      }
    },
    "implSpecificInfo": {}
     },
     "serializer": "JSON",
     "scopeOfLocality": "MEC_SYSTEM",
     "consumedLocalOnly": false,
     "isLocal": true,
     "livenessInterval": 60
  }
}

返回参数:

返回码:201

OK

名称 类型 描述 必选
serInstanceId String 服务实例ID
serName String 服务名称
serCategory Object 服务类别
>href String 目录参考
>id String 类别ID
>name String 类别名称
>version String 类别版本号
version String 服务版本号
state String 服务状态(ACTIVE/INACTIVE)
transportInfo Object
>id String ID
>name String 名称
> description String 描述
> type String 类型(REST_HTTP/MB_TOPIC_BASED/MB_ROUTING/MB_PUBSUB/RPC/RPC_STREAMING/WEBSOCKET)
> protocol String 协议名称
> version String 版本号
> endpoint Ojbect endpoint,三种信息其中的一个(uris/addresses/alternative)
>>uris Array[String] URI格式的服务入口信息列表
>>addresses Array[Object] 服务入口信息地址列表(IP地址+端口号)
>>>host String IP地址
>>>port String 端口号
>>alternative String 已实现格式或者外部规范定义的服务入口信息
> security Object 安全信息
>> oAuth2Info Object OAuth2.0参数
>>> grantTypes Array[String] 准予类型(OAUTH2_AUTHORIZATION_CODE/OAUTH2_IMPLICIT_GRANT/OAUTH2_RESOURCE_OWNER/OAUTH2_CLIENT_CREDENTIALS)
>>> tokenEndpoint String Token endpoint
> implSpecificInfo String 其他实现信息
serializer String 序列化类型(JSON/XML/PROTOBUF3)
scopeOfLocality String 地域范围(MEC_SYSTEM/MEC_HOST/NFVI_POP/ZONE/ZONE_GROUP/NFVI_NODE),默认值MEC_HOST
consumedLocalOnly boolean 是否只被本地域APP消费(true/false)
isLocal boolean 是否在本地域(true/false)
livenessInterval integer Interval (in seconds) between two consecutive heartbeat messages
_links Object Links to resources related to this resource. Shall be absent in HTTP requests.
>self object Link to this resource. Shall be present in HTTP responses.
>>liveness string Link to the resource where the MEC platform expects the service instance to send the liveness information.

返回示例:

HTTP/1.1 201 OK
{
    "serInstanceId": "0bc92b06cc213d2ad8beda71bd0e1460",
    "serName": "FaceRegService",
    "serCategory": {
        "href": "/example/catalogue1",
        "id": "id12345",
        "name": "RNI",
        "version": "1.2.4"
    },
    "version": "4.5.7",
    "state": "ACTIVE",
    "transportId": "Rest1",
    "transportInfo": {
        "id": "TransId12345",
        "name": "REST",
        "description": "REST API",
        "type": "REST_HTTP",
        "protocol": "HTTP",
        "version": "2.0",
        "endpoint": {},
        "security": {
            "oAuth2Info": {
                    "grantTypes": [
                    "OAUTH2_CLIENT_CREDENTIALS"
                    ],
                    "tokenEndpoint": "/mecSerMgmtApi/security/TokenEndPoint"
            }
        },
        "implSpecificInfo": {}
    },
    "serializer": "JSON",
    "scopeOfLocality": "MEC_SYSTEM",
    "consumedLocalOnly": false,
    "isLocal": true,
    "livenessInterval": 60,
    "_links": {
      "self": {
        "liveness" : "/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/service/0bc92b06cc213d2ad8beda71bd0e1460/liveness"
      }
    }    
}

注:单个应用注册的服务数量应不超过50个,超出后服务将报错。

4. 更新应用服务

更新APP指定服务信息。

URL

PUT /mep/mec_service_mgmt/v1/applications/{appInstanceId}/services/{serviceId}

请求参数:

名称 类型 描述 IN 必选
Content-Type String MIME类型, 填"application/json" header
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path
serviceId String APP服务实例ID path

Body参数:

名称 类型 描述 必选
serName String 服务名称(字母/数字/_/-的组合,但不能以_和-开头或结尾),最大长度128
serCategory Object 服务类别
>href String 目录参考
>id String 类别ID,字母与数字组合,最大长度64
>name String 类别名称
>version String 类别版本号
version String 服务版本号(例如:1;1.0;1.0.2)
state String 服务状态(ACTIVE/INACTIVE)
transportId String 服务信息ID,字母与数字组合,最大长度64
transportInfo Object 服务信息
>id String ID,字母与数字组合,最大长度64
>name String 名称(字母/数字/_/-的组合,但不能以_和-开头或结尾),最大长度128
> description String 描述,最大长度128
> type String 类型(REST_HTTP/MB_TOPIC_BASED/MB_ROUTING/MB_PUBSUB/RPC/RPC_STREAMING/WEBSOCKET)
> protocol String 协议名称,最大长度32
> version String 版本号
> endpoint Object Endpoint,三种信息其中的一个(uris/addresses/alternative)
>>uris Array[String] URI格式的服务入口信息列表
>>addresses Array[Object] 服务入口信息地址列表(IP地址+端口号)
>>>host String IP地址。例如:192.168.0.1
>>>port String 端口号(<=65535)。例如:8080
>>alternative String 已实现格式或者外部规范定义的服务入口信息
> security Object 安全信息
>> oAuth2Info Object OAuth2.0参数
>>> grantTypes String 准予类型(OAUTH2_AUTHORIZATION_CODE/OAUTH2_IMPLICIT_GRANT/OAUTH2_RESOURCE_OWNER/OAUTH2_CLIENT_CREDENTIALS)
>>> tokenEndpoint String Token endpoint
> implSpecificInfo String 其他实现信息
serializer String 序列化类型(JSON/XML/PROTOBUF3)
scopeOfLocality String 地域范围(MEC_SYSTEM/MEC_HOST/NFVI_POP/ZONE/ZONE_GROUP/NFVI_NODE),默认值MEC_HOST
consumedLocalOnly boolean 是否只被本地域APP消费(true/false)
isLocal boolean 是否在本地域(true/false)
livenessInterval integer Interval (in seconds) between two consecutive heartbeat messages

请求示例:

PUT /mep/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/services/0bc92b06cc213d2ad8beda71bd0e1460
{
        "header": [
            {
                "key": "Content-Type",
                "value": "application/json",
                "key": "Authorization",
                "value": "Bearer xxx"
            }
        ],
        "body": {
            "serName": "FaceRegService",
            "serCategory": {
                "href": "/example/catalogue1",
                "id": "id12345",
                "name": "RNI",
                "version": "1.2.4"
            },
            "version": "4.5.7",
            "state": "ACTIVE",
            "transportId": "Rest1",
            "transportInfo": {
                "id": "TransId12345",
                "name": "REST",
                "description": "REST API",
                "type": "REST_HTTP",
                "protocol": "HTTP",
                "version": "2.0",
                "endpoint": {},
                "security": {
                    "oAuth2Info": {
                        "grantTypes": [
                            "OAUTH2_CLIENT_CREDENTIALS"
                        ],
                        "tokenEndpoint": "/mecSerMgmtApi/security/TokenEndPoint"
                    }
                },
                "implSpecificInfo": {}
            },
            "serializer": "JSON",
            "scopeOfLocality": "MEC_SYSTEM",
            "consumedLocalOnly": false,
            "isLocal": true,
            "livenessInterval": 60
        }
}

返回参数:

返回码:200

OK

名称 类型 描述 必选
serInstanceId String 服务实例ID
serName String 服务名称
serCategory Object 服务类别
>href String 目录参考
>id String 类别ID
>name String 类别名称
>version String 类别版本号
version String 服务版本号
state String 服务状态(ACTIVE/INACTIVE)
transportInfo Object 服务信息
>id String ID
>name String 名称
> description String 描述
> type String 类型(REST_HTTP/MB_TOPIC_BASED/MB_ROUTING/MB_PUBSUB/RPC/RPC_STREAMING/WEBSOCKET)
> protocol String 协议名称
> version String 版本号
> endpoint Object endpoint,三种信息其中的一个(uris/addresses/alternative)
>>uris Array[String] URI格式的服务入口信息列表
>>addresses Array[Object] 服务入口信息地址列表(IP地址+端口号)
>>>host String IP地址
>>>port String 端口号
>>alternative String 已实现格式或者外部规范定义的服务入口信息
> security Object 安全信息
>> oAuth2Info Object OAuth2.0参数
>>> grantTypes String 准予类型(OAUTH2_AUTHORIZATION_CODE/OAUTH2_IMPLICIT_GRANT/OAUTH2_RESOURCE_OWNER/OAUTH2_CLIENT_CREDENTIALS)
>>> tokenEndpoint String Token endpoint
> implSpecificInfo String 其他实现信息
serializer String 序列化类型(JSON/XML/PROTOBUF3)
scopeOfLocality String 地域范围(MEC_SYSTEM/MEC_HOST/NFVI_POP/ZONE/ZONE_GROUP/NFVI_NODE),默认值MEC_HOST
consumedLocalOnly boolean 是否只被本地域APP消费(true/false)
isLocal boolean 是否在本地域(true/false)
livenessInterval integer Interval (in seconds) between two consecutive heartbeat messages
_links Object Links to resources related to this resource. Shall be absent in HTTP requests.
>self object Link to this resource. Shall be present in HTTP responses.
>>liveness string Link to the resource where the MEC platform expects the service instance to send the liveness information.

返回示例:

HTTP/1.1 200 OK
{
    "serInstanceId": "0bc92b06cc213d2ad8beda71bd0e1460",
    "serName": "FaceRegService",
    "serCategory": {
        "href": "/example/catalogue1",
        "id": "id12345",
        "name": "RNI",
        "version": "1.2.4"
    },
    "version": "4.5.7",
    "state": "ACTIVE",
    "transportId": "Rest1",
    "transportInfo": {
        "id": "TransId12345",
        "name": "REST",
        "description": "REST API",
        "type": "REST_HTTP",
        "protocol": "HTTP",
        "version": "2.0",
        "endpoint": {},
        "security": {
            "oAuth2Info": {
                "grantTypes": [
                    "OAUTH2_CLIENT_CREDENTIALS"
                ],
                "tokenEndpoint": "/mecSerMgmtApi/security/TokenEndPoint"
            }
        },
        "implSpecificInfo": {}
    },
    "serializer": "JSON",
    "scopeOfLocality": "MEC_SYSTEM",
    "consumedLocalOnly": false,
    "isLocal": true,
    "livenessInterval": 60,
    "_links": {
      "self": {
        "liveness" : "/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/service/0bc92b06cc213d2ad8beda71bd0e1460/liveness"
      }
    }    
}

5. 删除应用服务

删除APP指定服务。

URL

DELETE /mep/mec_service_mgmt/v1/applications/{appInstanceId}/services/{serviceId}

请求参数:

名称 类型 描述 IN 必选
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path
serviceId String APP服务实例ID path

Body参数:

请求示例:

DELETE /mep/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/services/0bc92b06cc213d2ad8beda71bd0e1460
{
    "header": [
        {
            "key": "Authorization",
            "value": "Bearer xxx"
        }
    ],
    "body": {
    }
}

返回参数:

返回码:204

OK

返回示例:

HTTP/1.1 204 OK
{
}

可用事件订阅相关接口

1. 查询可用事件订阅

查询指定APP的可用事件订阅信息

URL

GET /mep/mec_service_mgmt/v1/applications/{appInstanceId}/subscriptions

请求参数:

名称 类型 描述 IN 必选
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path

Body参数:

请求示例:

GET /mep/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions
{
    "header": [
        {
            "key": "Authorization",
            "value": "Bearer xxx"
        }
    ]
}

返回参数:

返回码:200

OK

名称 类型 描述 必选
_links Object 结果信息
>self Object 调用者信息
>>href String 调用者URL
>subscriptions Array[Object] 订阅者列表
>>href String 订阅者URI
>>rel String 固定值SerAvailabilityNotificationSubscription

返回示例:

HTTP/1.1 200 OK
{
    "_links": {
        "self": {
            "href":"/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f /subscriptions"
        },
        "subscriptions": [
            {
                "href":"/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions/826a3890-8b05-416f-8d24-7a87e9eca731",
                "rel": "SerAvailabilityNotificationSubscription"
            }
        ]
    }
}

2. 注册可用事件订阅

为指定APP注册可用事件订阅

URL

POST /mep/mec_service_mgmt/v1/applications/{appInstanceId}/subscriptions

请求参数:

名称 类型 描述 IN 必选
Content-Type String MIME类型,填"application/json" header
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path

Body参数:

名称 类型 描述 必选
subscriptionType String 订阅类型(SerAvailabilityNotificationSubscription)
callbackReference String 用于接收通知的回调URI,不支持域名格式,仅支持IP地址+URL,且不能包含localhost、127.x.x.x、mepserver容器IP网段,例如:https://159.138.1.2:8080/xxx
filteringCriteria Object 过滤条件列表
>serInstanceIds Array[String] 上报事件的应用服务实例ID列表
>serNames Array[String] 上报事件的应用服务实例名称列表(每个服务实例名称都是字母/数字/_/-的组合,但不能以_和-开头或结尾,最大长度128)
>serCategories Array[Object] 上报事件的应用服务类别列表
>>href String 类别参考
>>id String 类别ID,最大长度64
>>name String 类别名称(字母/数字/_/-的组合,但不能以_和-开头或结尾),最大长度128
>>version String 类别版本号
>states Array[String] 上报事件的应用服务状态(ACTIVE/INACTIVE)
>isLocal boolean 是否在本地域(true/false)

请求示例:

POST /mep/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions
{
    "header": [
        {
            "key": "Content-Type",
            "value": "application/json",
            "key": "Authorization",
            "value": "Bearer xxx"
        }
    ]
    "body": {
        "subscriptionType": "SerAvailabilityNotificationSubscription",
        "callbackReference": "https://159.138.1.2:8080/callback",
        "filteringCriteria": {
            "serInstanceIds": [
                "0bc92b06cc213d2ad8beda71bd0e1460"
            ],
            "serNames": [
                "FaceRegService5"
            ],
            "serCategories": [
                {
                    "href": "/example/catalogue1",
                    "id": "id12345",
                    "name": "RNI",
                    "version": "1.2.2"
                }
            ],
            "states": [
                "ACTIVE"
            ],
            "isLocal": true
        }
    }
}

返回参数:

返回码:201

OK

名称 类型 描述 必选
subscriptionId String 订阅Id
subscriptionType String 订阅类型(SerAvailabilityNotificationSubscription)
callbackReference String 用于接收通知的回调URI,不支持域名格式,仅支持IP地址+URL,且不能包含localhost、127.x.x.x、mepserver容器IP网段,例如:https://159.138.1.2:8080/xxx
_links Object 调用者自身信息
>self Object 调用者自身信息
>>href String 调用者自身URI
filteringCriteria Object 过滤条件列表
>serInstanceIds Array[String] 上报事件的应用服务实例ID列表
>serNames Array[String] 上报事件的应用服务实例名称列表
>serCategories Array[Object] 上报事件的应用服务类别列表
>>href String 类别参考
>>id String 类别ID
>>name String 类别名称
>>version String 类别版本号
>states Array[String] 上报事件的应用服务状态(ACTIVE/INACTIVE)
>isLocal boolean 是否在本地域(true/false)

返回示例:

HTTP/1.1 201 OK
{
    "subscriptionId": "826a3890-8b05-416f-8d24-7a87e9eca731",
    "subscriptionType": "SerAvailabilityNotificationSubscription",
    "callbackReference": "https://159.138.1.2:8080/callback",
    "_links": {
        "self": {
            "href":"/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions/826a3890-8b05-416f-8d24-7a87e9eca731"
        }
    },
    "filteringCriteria": {
        "serInstanceIds": [
            "0bc92b06cc213d2ad8beda71bd0e1460"
        ],
        "serNames": [
            "FaceRegService5"
        ],
        "serCategories": [
            {
                "href": "/example/catalogue1",
                "id": "id12345",
                "name": "RNI",
                "version": "1.2.2"
            }
        ],
        "states": [
            "ACTIVE"
        ],
        "isLocal": true
    }
}

注:单个应用注册的可用事件订阅数量应不超过50个,超出后服务将报错。

3. 删除可用事件订阅

删除指定可用事件订阅信息

URL

DELETE /mep/mec_service_mgmt/v1/applications/{appInstanceId}/subscriptions/{subscriptionId}

请求参数:

名称 类型 描述 IN 必选
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path
subscriptionId String 事件订阅ID path

Body参数:

请求示例:

DELETE /mep/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions/826a3890-8b05-416f-8d24-7a87e9eca731
{
    "header": [
        {
            "key": "Authorization",
            "value": "Bearer xxx"
        }
    ]
}

返回参数:

返回码:204

OK

返回示例:

HTTP/1.1 204 OK
{    
}

4. 查询指定可用事件订阅

查询指定ID的可用事件订阅信息

URL

GET /mep/mec_service_mgmt/v1/applications/{appInstanceId}/subscriptions/{subscriptionId}

请求参数:

名称 类型 描述 IN 必选
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path
subscriptionId String 事件订阅ID path

Body参数:

请求示例:

GET /mep/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions/826a3890-8b05-416f-8d24-7a87e9eca731
{
    "header": [
        { 
            "key": "Authorization",
            "value": "Bearer xxx"
        }
    ]
}

返回参数:

返回码:200

OK

名称 类型 描述 必选
subscriptionType String 订阅类型(SerAvailabilityNotificationSubscription)
callbackReference String 用于接收通知的回调URI,不支持域名格式,仅支持IP地址+URL,且不能包含localhost、127.x.x.x、mepserver容器IP网段,例如:https://159.138.1.2:8080/xxx
_links Object 调用者自身信息
>self Object 调用者自身信息
>>href String 调用者自身URI
filteringCriteria Object 过滤条件列表
>serInstanceIds Array[String] 上报事件的应用服务实例ID列表
>serNames Array[String] 上报事件的应用服务实例名称列表
>serCategories Array[Object] 上报事件的应用服务类别列表
>>href String 类别参考
>>id String 类别ID
>>name String 类别名称
>>version String 类别版本号
>states Array[String] 上报事件的应用服务状态(ACTIVE/INACTIVE)
>isLocal boolean 是否在本地域(true/false)

返回示例:

HTTP/1.1 200 OK
{
    "subscriptionType": "SerAvailabilityNotificationSubscription",
    "callbackReference": "https://159.138.1.2:8080/callback",
    "_links": {
        "self": {
            "href":"/mec_service_mgmt/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions/826a3890-8b05-416f-8d24-7a87e9eca731"
        }
    },
    "filteringCriteria": {
        "serInstanceIds": [
            "0bc92b06cc213d2ad8beda71bd0e1460"
        ],
        "serNames": [
            "FaceRegService5"
        ],
        "serCategories": [
            {
                "href": "/example/catalogue1",
                "id": "id12345",
                "name": "RNI",
                "version": "1.2.2"
            }
        ],
        "states": [
            "ACTIVE"
        ],
        "isLocal": true
    }
}

终止事件订阅相关接口

1. 查询终止事件订阅

查询指定APP的终止事件订阅信息

URL

GET /mep/mec_app_support/v1/applications/{appInstanceId}/subscriptions

请求参数:

名称 类型 描述 IN 必选
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path

Body参数:

请求示例:

GET /mep/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions
{
    "header": [
        {
            "key": "Authorization",
            "value": "Bearer xxx"
        }
    ]
}

返回参数:

返回码:200

OK

名称 类型 描述 必选
_links Object 结果信息
>self Object 调用者信息
>>href String 调用者URL
>subscriptions Array[Object] 订阅者列表
>>href String 订阅者URI
>>rel String 固定值AppTerminationNotificationSubscription

返回示例:

HTTP/1.1 200 OK
{
    "_links": {
        "self": {
            "href":"/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f /subscriptions"
        },
        "subscriptions": [
            {
                "href":"/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions/826a3890-8b05-416f-8d24-7a87e9eca731",
                "rel": "AppTerminationNotificationSubscription"
            }
        ]
    }
}

2. 注册终止事件订阅

为指定APP注册终止事件订阅

URL

POST /mep/mec_app_support/v1/applications/{appInstanceId}/subscriptions

请求参数:

名称 类型 描述 IN 必选
Content-Type String MIME类型,填"application/json" header
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path

Body参数:

名称 类型 描述 必选
subscriptionType String 订阅类型(AppTerminationNotificationSubscription)
callbackReference String 用于接收通知的回调URI,不支持域名格式,仅支持IP地址+URL,且不能包含localhost、127.x.x.x、mepserver容器IP网段,例如:https://159.138.1.2:8080/xxx
appInstanceId String APP实例ID(UUID)

请求示例:

POST /mep/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions
{
    "header": [
        {
            "key": "Content-Type",
            "value": "application/json",
            "key": "Authorization",
            "value": "Bearer xxx"
        }
    ]
    "body": {
        "subscriptionType": "AppTerminationNotificationSubscription",
        "callbackReference": "https://159.138.1.2:8080/callback",
        "appInstanceId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f"
    }
}

返回参数:

返回码:201

OK

名称 类型 描述 必选
subscriptionId String 订阅Id
subscriptionType String 订阅类型(AppTerminationNotificationSubscription)
callbackReference String 用于接收通知的回调URI,不支持域名格式,仅支持IP地址+URL,且不能包含localhost、127.x.x.x、mepserver容器IP网段,例如:https://159.138.1.2:8080/xxx
_links Object 调用者自身信息
>self Object 调用者自身信息
>>href String 调用者自身URI
appInstanceId String

返回示例:

HTTP/1.1 201 OK
{
    "subscriptionId": "826a3890-8b05-416f-8d24-7a87e9eca731",
    "subscriptionType": "AppTerminationNotificationSubscription",
    "callbackReference": "https://159.138.1.2:8080/callback",
    "_links": {
        "self": {
            "href":"/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions/826a3890-8b05-416f-8d24-7a87e9eca731"
        }
    },
    "appInstanceId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f"
}

注:单个应用注册的终止事件订阅数量应不超过50个,超出后服务将报错。

3. 删除终止事件订阅

删除指定终止事件订阅信息

URL

DELETE /mep/mec_app_support/v1/applications/{appInstanceId}/subscriptions/{subscriptionId}

请求参数:

名称 类型 描述 IN 必选
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path
subscriptionId String 事件订阅ID(UUID) path

Body参数:

请求示例:

DELETE /mep/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions/826a3890-8b05-416f-8d24-7a87e9eca731
{
    "header": [
        {
            "key": "Authorization",
            "value": "Bearer xxx"
        }
    ]
}

返回参数:

返回码:204

OK

返回示例:

HTTP/1.1 204 OK
{

}

4. 查询指定终止事件订阅

查询指定ID的终止事件订阅信息

URL

GET /mep/mec_app_support/v1/applications/{appInstanceId}/subscriptions/{subscriptionId}

请求参数:

名称 类型 描述 IN 必选
Authorization String Token信息,格式:Bearer token信息 header
appInstanceId String APP实例ID(UUID) path
subscriptionId String 事件订阅ID(UUID) path

Body参数:

请求示例:

GET /mep/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions/826a3890-8b05-416f-8d24-7a87e9eca731
{
    "header": [
        {
            "key": "Authorization",
            "value": "Bearer xxx"
        }
    ]
}

返回参数:

返回码:200

OK

名称 类型 描述 必选
subscriptionType String 订阅类型( AppTerminationNotificationSubscription)
callbackReference String 用于接收通知的回调URI,不支持域名格式,仅支持IP地址+URL,且不能包含localhost、127.x.x.x、mepserver容器IP网段,例如:https://159.138.1.2:8080/xxx
_links Object 调用者自身信息
>self Object 调用者自身信息
>>href String 调用者自身URI
appInstanceId String

返回示例:

HTTP/1.1 200 OK
{
    "subscriptionType": "AppTerminationNotificationSubscription",
    "callbackReference": "https://159.138.1.2:8080/callback",
    "_links": {
        "self": {
            "href":"/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/subscriptions/826a3890-8b05-416f-8d24-7a87e9eca731"
        }
    },
    "appInstanceId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f "
}

DNS rule configuration interfaces

Using the Mp1 interfaces mec apps can query and activate/deactivate dns rules associated to it. Implementation of this interface are as per the ETSI GS MEC 011 V2.1.1 document.

1. Query all dns rules

Query all DNS rules associated with an application.

URL

GET /mep/mec_app_support/v1/applications/{appInstanceId}/dns_rules

Request parameters:

Name Type Description IN Required
Authorization String Token信息,格式:Bearer token信息 header Yes
appInstanceId String APP实例ID(UUID) path Yes

Body parameters:

None

Example Request:

GET /mep/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/dns_rules

Return Parameters:

Name Type Description
dnsRuleId string Rule Id
domainName string MEC app domain name
ipAddressType enum {IP_V4, IP_V6} MEC app ip address type
ipAddress string MEC app ip address
ttl int (non-zero value) TTL value
state enum {ACTIVE, INACTIVE} State

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
[
    {
        "dnsRuleId": "20a19292-384c-4d44-ba64-a8e8269f0f25",
        "domainName": "voicerecgservice.com",
        "ipAddressType": "IP_V4",
        "ipAddress": "192.168.27.48",
        "ttl": 30,
        "state": "ACTIVE"
    },
    {
        "dnsRuleId": "bbc14ed1-92f4-457f-95e8-93aa723a9f12",
        "domainName": "facerecgservice.com",
        "ipAddressType": "IP_V4",
        "ipAddress": "192.168.147.240",
        "ttl": 30,
        "state": "INACTIVE"
    }
]

2. Query a specific dns rule

Query single DNS rule associated with an application.

URL

GET /mep/mec_app_support/v1/applications/{appInstanceId}/dns_rules/{dnsRuleId}

Request parameters:

Name Type Description IN Required
Authorization String Token信息,格式:Bearer token信息 header Yes
appInstanceId String APP实例ID(UUID) path Yes
dnsRuleId String DNS rule identifier(UUID) path Yes

Body parameters:

None

Example Request:

GET /mep/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/dns_rules/bbc14ed1-92f4-457f-95e8-93aa723a9f12

Return Parameters:

Name Type Description
dnsRuleId string Rule Id
domainName string MEC app domain name
ipAddressType enum {IP_V4, IP_V6} MEC app ip address type
ipAddress string MEC app ip address
ttl int (non-zero value) TTL value
state enum {ACTIVE, INACTIVE} State

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
{
    "dnsRuleId": "bbc14ed1-92f4-457f-95e8-93aa723a9f12",
    "domainName": "facerecgservice.com",
    "ipAddressType": "IP_V4",
    "ipAddress": "192.168.147.240",
    "ttl": 30,
    "state": "INACTIVE"
}

3. Update a specific dns rule

Modify the state of a rule associated with an application. This interface can modify the state from ACTIVE to INACTIVE or vice versa. No other field can be modified using this interface.

URL

PUT /mep/mec_app_support/v1/applications/{appInstanceId}/dns_rules/{dnsRuleId}

Request parameters:

Name Type Description IN Required
Authorization String Token信息,格式:Bearer token信息 header Yes
appInstanceId String APP实例ID(UUID) path Yes
dnsRuleId String DNS rule identifier(UUID) path Yes

Body parameters:

Name Type Description Required
dnsRuleId string Rule Id No, if present must be same with actual
domainName string MEC app domain name No, if present must be same with actual
ipAddressType enum {IP_V4, IP_V6} MEC app ip address type No, if present must be same with actual
ipAddress string MEC app ip address No, if present must be same with actual
ttl int (non-zero value) TTL value No, if present must be same with actual
state enum {ACTIVE, INACTIVE} State Yes

Example Request:

PUT /mep/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/dns_rules/bbc14ed1-92f4-457f-95e8-93aa723a9f12
{
    "dnsRuleId": "bbc14ed1-92f4-457f-95e8-93aa723a9f12",
    "domainName": "facerecgservice.com",
    "ipAddressType": "IP_V4",
    "ipAddress": "192.168.147.240",
    "ttl": 30,
    "state": "ACTIVE"
}

Return Parameters:

Name Type Description
dnsRuleId string Rule Id
domainName string MEC app domain name
ipAddressType enum {IP_V4, IP_V6} MEC app ip address type
ipAddress string MEC app ip address
ttl int (non-zero value) TTL value
state enum {ACTIVE, INACTIVE} State

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
{
    "dnsRuleId": "bbc14ed1-92f4-457f-95e8-93aa723a9f12",
    "domainName": "facerecgservice.com",
    "ipAddressType": "IP_V4",
    "ipAddress": "192.168.147.240",
    "ttl": 30,
    "state": "ACTIVE"
}

Traffic rule configuration interfaces

Using the Mp1 interfaces mec apps can query and modify the traffic rules associated to it. Implementation of this interface are as per the ETSI GS MEC 011 V2.1.1 document.

1. Query all traffic rules

Query all traffic rules associated with an application.

URL

GET /mep/mec_app_support/v1/applications/{appInstanceId}/traffic_rules

Request parameters:

Name Type Description IN Required
Authorization String Token信息,格式:Bearer token信息 header Yes
appInstanceId String APP实例ID(UUID) path Yes

Body parameters:

None

Example Request:

GET /mep/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/traffic_rules

Return Parameters:

Name Type Description
trafficRuleId string Traffic rule ID.
filterType enum {FLOW, PACKET} Filter type.
priority number (1 ~ 256) Priority of the traffic rule. If any conflict in the traffic rules, then higher the priority higher the precedence.
trafficFilter list List of traffic filters.
> srcAddress list List of source ip address.
> dstAddress list List of destination ip address.
> srcPort list List of source port address.
> dstPort list List of destination port address.
> protocol list List of protocols.
> tag list List of tags.
> srcTunnelAddress list List of source tunnel address.
> tgtTunnelAddress list List of target tunnel address.
> srcTunnelPort list List of source tunnel ports.
> dstTunnelPort list List of destination tunnel ports.
> qCI number Match packets with same QCI.
> dSCP number Match packets with same DSCP.
> tC number Match packets with same TC.
action enum {DROP, FORWARD_DECAPSULATED, FORWARD_AS_IS, PASSTHROUGH, DUPLICATE_DECAPSULATED, DUPLICATE_AS_IS} Action when traffic rule matches.
dstInterface list Destination interface parameters.
> interfaceType enum {TUNNEL, MAC, IP} Match packets with same TC.
> tunnelInfo object Tunnel parameters.
>> tunnelType enum {GTP_U, GRE} Tunnel type.
>> tunnelDstAddress string Destination IP address.
>> tunnelSrcAddress string Source IP address.
> srcMacAddress string Source MAC address
> dstMacAddress string Destination MAC address.
> dstIpAddress string Destination IP address.
state enum {ACTIVE, INACTIVE} State of the rule.

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
[
  {
    "trafficRuleId": "TrafficRule1",
    "filterType": "FLOW",
    "priority": 1,
    "trafficFilter": [
      {
        "srcAddress": [
          "192.158.1.1/28"
        ],
        "dstAddress": [
          "192.168.1.1/28"
        ],
        "srcPort": [
          "8080"
        ],
        "dstPort": [
          "8080"
        ],
        "protocol": [
          "TCP"
        ],
        "tag": null,
        "srcTunnelAddress": null,
        "tgtTunnelAddress": null,
        "srcTunnelPort": null,
        "dstTunnelPort": null,
        "qCI": 2,
        "dSCP": 0,
        "tC": 1
      }
    ],
    "action": "DROP",
    "dstInterface": [],
    "state": "ACTIVE"
  }
]

2. Query a specific traffic rule

Query single traffic rule associated with an application.

URL

GET /mep/mec_app_support/v1/applications/{appInstanceId}/traffic_rules/{trafficRuleId}

Request parameters:

Name Type Description IN Required
Authorization String Token信息,格式:Bearer token信息 header Yes
appInstanceId String APP实例ID(UUID) path Yes
trafficRuleId String Traffic rule identifier(UUID) path Yes

Body parameters:

None

Example Request:

GET /mep/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/traffic_rules/TrafficRule1

Return Parameters:

Name Type Description
trafficRuleId string Traffic rule ID.
filterType enum {FLOW, PACKET} Filter type.
priority number (1 ~ 256) Priority of the traffic rule. If any conflict in the traffic rules, then higher the priority higher the precedence.
trafficFilter list List of traffic filters.
> srcAddress list List of source ip address.
> dstAddress list List of destination ip address.
> srcPort list List of source port address.
> dstPort list List of destination port address.
> protocol list List of protocols.
> tag list List of tags.
> srcTunnelAddress list List of source tunnel address.
> tgtTunnelAddress list List of target tunnel address.
> srcTunnelPort list List of source tunnel ports.
> dstTunnelPort list List of destination tunnel ports.
> qCI number Match packets with same QCI.
> dSCP number Match packets with same DSCP.
> tC number Match packets with same TC.
action enum {DROP, FORWARD_DECAPSULATED, FORWARD_AS_IS, PASSTHROUGH, DUPLICATE_DECAPSULATED, DUPLICATE_AS_IS} Action when traffic rule matches.
dstInterface list Destination interface parameters.
> interfaceType enum {TUNNEL, MAC, IP} Match packets with same TC.
> tunnelInfo object Tunnel parameters.
>> tunnelType enum {GTP_U, GRE} Tunnel type.
>> tunnelDstAddress string Destination IP address.
>> tunnelSrcAddress string Source IP address.
> srcMacAddress string Source MAC address
> dstMacAddress string Destination MAC address.
> dstIpAddress string Destination IP address.
state enum {ACTIVE, INACTIVE} State of the rule.

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
{
  "trafficRuleId": "TrafficRule1",
  "filterType": "FLOW",
  "priority": 1,
  "trafficFilter": [
    {
      "srcAddress": [
        "192.158.1.1/28"
      ],
      "dstAddress": [
        "192.168.1.1/28"
      ],
      "srcPort": [
        "8080"
      ],
      "dstPort": [
        "8080"
      ],
      "protocol": [
        "TCP"
      ],
      "tag": null,
      "srcTunnelAddress": null,
      "tgtTunnelAddress": null,
      "srcTunnelPort": null,
      "dstTunnelPort": null,
      "qCI": 2,
      "dSCP": 0,
      "tC": 1
    }
  ],
  "action": "DROP",
  "dstInterface": [],
  "state": "ACTIVE"
}

3. Update a specific traffic rule

Modify the traffic rule associated with an application.

URL

PUT /mep/mec_app_support/v1/applications/{appInstanceId}/traffic_rules/{trafficRuleId}

Request parameters:

Name Type Description IN Required
Authorization String Token信息,格式:Bearer token信息 header Yes
appInstanceId String APP实例ID(UUID) path Yes
trafficRuleId String Traffic rule identifier(UUID) path Yes

Body parameters:

Name Type Description
trafficRuleId string Traffic rule ID.
filterType enum {FLOW, PACKET} Filter type.
priority number (1 ~ 256) Priority of the traffic rule. If any conflict in the traffic rules, then higher the priority higher the precedence.
trafficFilter list List of traffic filters.
> srcAddress list List of source ip address.
> dstAddress list List of destination ip address.
> srcPort list List of source port address.
> dstPort list List of destination port address.
> protocol list List of protocols.
> tag list List of tags.
> srcTunnelAddress list List of source tunnel address.
> tgtTunnelAddress list List of target tunnel address.
> srcTunnelPort list List of source tunnel ports.
> dstTunnelPort list List of destination tunnel ports.
> qCI number Match packets with same QCI.
> dSCP number Match packets with same DSCP.
> tC number Match packets with same TC.
action enum {DROP, FORWARD_DECAPSULATED, FORWARD_AS_IS, PASSTHROUGH, DUPLICATE_DECAPSULATED, DUPLICATE_AS_IS} Action when traffic rule matches.
dstInterface list Destination interface parameters.
> interfaceType enum {TUNNEL, MAC, IP} Match packets with same TC.
> tunnelInfo object Tunnel parameters.
>> tunnelType enum {GTP_U, GRE} Tunnel type.
>> tunnelDstAddress string Destination IP address.
>> tunnelSrcAddress string Source IP address.
> srcMacAddress string Source MAC address
> dstMacAddress string Destination MAC address.
> dstIpAddress string Destination IP address.
state enum {ACTIVE, INACTIVE} State of the rule.

Example Request:

PUT /mep/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/traffic_rules/TrafficRule1
{
  "trafficRuleId": "TrafficRule1",
  "filterType": "FLOW",
  "priority": 1,
  "trafficFilter": [
    {
      "srcAddress": [
        "192.158.1.1/28"
      ],
      "dstAddress": [
        "192.168.1.1/28"
      ],
      "srcPort": [
        "8080"
      ],
      "dstPort": [
        "8080"
      ],
      "protocol": [
        "TCP"
      ],
      "tag": null,
      "srcTunnelAddress": null,
      "tgtTunnelAddress": null,
      "srcTunnelPort": null,
      "dstTunnelPort": null,
      "qCI": 2,
      "dSCP": 0,
      "tC": 1
    }
  ],
  "action": "DROP",
  "dstInterface": [],
  "state": "ACTIVE"
}

Return Parameters:

Name Type Description
trafficRuleId string Traffic rule ID.
filterType enum {FLOW, PACKET} Filter type.
priority number (1 ~ 256) Priority of the traffic rule. If any conflict in the traffic rules, then higher the priority higher the precedence.
trafficFilter list List of traffic filters.
> srcAddress list List of source ip address.
> dstAddress list List of destination ip address.
> srcPort list List of source port address.
> dstPort list List of destination port address.
> protocol list List of protocols.
> tag list List of tags.
> srcTunnelAddress list List of source tunnel address.
> tgtTunnelAddress list List of target tunnel address.
> srcTunnelPort list List of source tunnel ports.
> dstTunnelPort list List of destination tunnel ports.
> qCI number Match packets with same QCI.
> dSCP number Match packets with same DSCP.
> tC number Match packets with same TC.
action enum {DROP, FORWARD_DECAPSULATED, FORWARD_AS_IS, PASSTHROUGH, DUPLICATE_DECAPSULATED, DUPLICATE_AS_IS} Action when traffic rule matches.
dstInterface list Destination interface parameters.
> interfaceType enum {TUNNEL, MAC, IP} Match packets with same TC.
> tunnelInfo object Tunnel parameters.
>> tunnelType enum {GTP_U, GRE} Tunnel type.
>> tunnelDstAddress string Destination IP address.
>> tunnelSrcAddress string Source IP address.
> srcMacAddress string Source MAC address
> dstMacAddress string Destination MAC address.
> dstIpAddress string Destination IP address.
state enum {ACTIVE, INACTIVE} State of the rule.

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
{
  "trafficRuleId": "TrafficRule1",
  "filterType": "FLOW",
  "priority": 1,
  "trafficFilter": [
    {
      "srcAddress": [
        "192.158.1.1/28"
      ],
      "dstAddress": [
        "192.168.1.1/28"
      ],
      "srcPort": [
        "8080"
      ],
      "dstPort": [
        "8080"
      ],
      "protocol": [
        "TCP"
      ],
      "tag": null,
      "srcTunnelAddress": null,
      "tgtTunnelAddress": null,
      "srcTunnelPort": null,
      "dstTunnelPort": null,
      "qCI": 2,
      "dSCP": 0,
      "tC": 1
    }
  ],
  "action": "DROP",
  "dstInterface": [],
  "state": "ACTIVE"
}

Mm5 Interface for appd configurations

Using the Mm5 interfaces MECM can create, query, update or delete the appd configurations which includes multiple dns and traffic rules associated to an application. Implementation of this interface are specified in ETSI GS MEC 010-1 V1.1.1 and ETSI GS MEC 010-2 V2.1.1 documents.

1. Create a new appd configurations

Create a new appd configuration and associate it with a MEC application. Each configuration can have thirty-two DNS rules and sixteen Traffic rules. There can be only one appd configuration per application at a time and the appd configuration is an asynchronous in nature. Once the request is received in the mep, after validation mep will start a task to handle multiple dns and traffic rules and return a task id to the caller of the API. Using the task-id the caller can check the status of the operation at any time.

URL

POST /mepcfg/app_lcm/v1/applications/{appInstanceId}/appd_configuration

Request parameters:

Name Type Description IN Required
appInstanceId String APP实例ID(UUID) path Yes

Body parameters:

Name Type Description Required
appTrafficRule list List of traffic rules. Max 16. No
> trafficRuleId string Traffic rule ID. Yes
> filterType enum {FLOW, PACKET} Filter type. Yes
> priority number (1 ~ 256) Priority of the traffic rule. If any conflict in the traffic rules, then higher the priority higher the precedence. Yes
> trafficFilter list List of traffic filters. Max 16. No
>> srcAddress list List of source ip address. Max 64. No
>> dstAddress list List of destination ip address. Max 64. No
>> srcPort list List of source port address. No
>> dstPort list List of destination port address. No
>> protocol list List of protocols. Max 8. Yes
>> tag list List of tags. Max 8. Yes
>> srcTunnelAddress list List of source tunnel address. No
>> tgtTunnelAddress list List of target tunnel address. No
>> srcTunnelPort list List of source tunnel ports. No
>> dstTunnelPort list List of destination tunnel ports. No
>> qCI number Match packets with same QCI. No
>> dSCP number Match packets with same DSCP. No
>> tC number Match packets with same TC. No
> action enum {DROP, FORWARD_DECAPSULATED, FORWARD_AS_IS, PASSTHROUGH, DUPLICATE_DECAPSULATED, DUPLICATE_AS_IS} Action when traffic rule matches. Yes
> dstInterface list Destination interface parameters. Max 2. No
>> interfaceType enum {TUNNEL, MAC, IP} Match packets with same TC. Yes
>> tunnelInfo object Tunnel parameters. No
>>> tunnelType enum {GTP_U, GRE} Tunnel type. Yes
>>> tunnelDstAddress string Destination IP address. No
>>> tunnelSrcAddress string Source IP address. No
>> srcMacAddress string Source MAC address No
>> dstMacAddress string Destination MAC address. No
>> dstIpAddress string Destination IP address. No
> state enum {ACTIVE, INACTIVE} State of the rule. No
appDNSRule list List of DNS rules. Max 32. No
> dnsRuleId string DNS rule ID. Yes
> domainName string Domain name. Yes
> ipAddressType enum {IPv4, IPv6} IP address type. Yes
> ipAddress string IP address. Yes
> ttl number Time To Live value. Yes
> state enum {ACTIVE, INACTIVE} Rule state. Yes
appSupportMp1 bool Whether Mp1 interface is supported. No
appName string Application name. Yes

Example Request:

POST /mepcfg/app_lcm/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/appd_configuration
{
  "appTrafficRule": [
    {
      "trafficRuleId": "TrafficRule1",
      "filterType": "FLOW",
      "priority": 1,
      "trafficFilter": [
        {
          "srcAddress": [
            "192.158.1.1/28"
          ],
          "dstAddress": [
            "192.168.1.1/28"
          ],
          "srcPort": [
            "8080"
          ],
          "dstPort": [
            "8080"
          ],
          "protocol": [
            "TCP"
          ],
          "qCI": 1,
          "dSCP": 0,
          "tC": 1
        }
      ],
      "action": "DROP",
      "state": "ACTIVE"
    }
  ],
  "appDNSRule": [
    {
      "dnsRuleId": "dnsRule1",
      "domainName": "facerecgservice.com",
      "ipAddressType": "IP_V4",
      "ipAddress": "192.168.147.240",
      "ttl": 30,
      "state": "ACTIVE"
    }
  ],
  "appSupportMp1": true,
  "appName": "abc1"
}

Return Parameters:

Name Type Description
taskId string Task ID
appInstanceId string Application instance ID
configResult string Configuration result
configPhase string Progress percentage
Detailed string Detailed reason

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
{
  "taskId": "d464dd0a-d927-4baf-bc2c-d902fb0b2c73",
  "appInstanceId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
  "configResult": "PROCESSING",
  "configPhase": "0",
  "Detailed": "Operation In progress"
}

2. Query appd configuration

Query appd configuration associated with an application.

URL

GET /mepcfg/app_lcm/v1/applications/{appInstanceId}/appd_configuration

Request parameters:

Name Type Description IN Required
appInstanceId String APP实例ID(UUID) path Yes

Body parameters:

None

Example Request:

GET /mepcfg/app_lcm/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/appd_configuration

Return Parameters:

Name Type Description
appTrafficRule list List of traffic rules.
> trafficRuleId string Traffic rule ID.
> filterType enum {FLOW, PACKET} Filter type.
> priority number (1 ~ 256) Priority of the traffic rule. If any conflict in the traffic rules, then higher the priority higher the precedence.
> trafficFilter list List of traffic filters.
>> srcAddress list List of source ip address.
>> dstAddress list List of destination ip address.
>> srcPort list List of source port address.
>> dstPort list List of destination port address.
>> protocol list List of protocols.
>> tag list List of tags.
>> srcTunnelAddress list List of source tunnel address.
>> tgtTunnelAddress list List of target tunnel address.
>> srcTunnelPort list List of source tunnel ports.
>> dstTunnelPort list List of destination tunnel ports.
>> qCI number Match packets with same QCI.
>> dSCP number Match packets with same DSCP.
>> tC number Match packets with same TC.
> action enum {DROP, FORWARD_DECAPSULATED, FORWARD_AS_IS, PASSTHROUGH, DUPLICATE_DECAPSULATED, DUPLICATE_AS_IS} Action when traffic rule matches.
> dstInterface list Destination interface parameters.
>> interfaceType enum {TUNNEL, MAC, IP} Match packets with same TC.
>> tunnelInfo object Tunnel parameters.
>>> tunnelType enum {GTP_U, GRE} Tunnel type.
>>> tunnelDstAddress string Destination IP address.
>>> tunnelSrcAddress string Source IP address.
>> srcMacAddress string Source MAC address
>> dstMacAddress string Destination MAC address.
>> dstIpAddress string Destination IP address.
> state enum {ACTIVE, INACTIVE} State of the rule.
appDNSRule list List of DNS rules.
> dnsRuleId string DNS rule ID.
> domainName string Domain name.
> ipAddressType enum {IPv4, IPv6} IP address type.
> ipAddress string IP address.
> ttl number Time To Live value.
> state enum {ACTIVE, INACTIVE} Rule state.
appSupportMp1 bool Whether Mp1 interface is supported.
appName string Application name.

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
{
  "appTrafficRule": [
    {
      "trafficRuleId": "TrafficRule1",
      "filterType": "FLOW",
      "priority": 1,
      "trafficFilter": [
        {
          "srcAddress": [
            "192.158.1.1/28"
          ],
          "dstAddress": [
            "192.168.1.1/28"
          ],
          "srcPort": [
            "8080"
          ],
          "dstPort": [
            "8080"
          ],
          "protocol": [
            "TCP"
          ],
          "tag": null,
          "srcTunnelAddress": null,
          "tgtTunnelAddress": null,
          "srcTunnelPort": null,
          "dstTunnelPort": null,
          "qCI": 2,
          "dSCP": 0,
          "tC": 1
        }
      ],
      "action": "DROP",
      "dstInterface": [],
      "state": "ACTIVE"
    }
  ],
  "appDNSRule": [
    {
      "dnsRuleId": "dnsRule1",
      "domainName": "facerecgservice.com",
      "ipAddressType": "IP_V4",
      "ipAddress": "192.168.147.240",
      "ttl": 30,
      "state": "ACTIVE"
    }
  ],
  "appSupportMp1": true,
  "appName": "abc1"
}

3. Modify appd configuration

Appd configuration for each applications can be configured using this interface. MEP will take the difference of existing configuration and the new modification input and then act on create/modify/delete of dns and/or traffic rules.

URL

PUT /mepcfg/app_lcm/v1/applications/{appInstanceId}/appd_configuration

Request parameters:

Name Type Description IN Required
appInstanceId String APP实例ID(UUID) path Yes

Body parameters:

Name Type Description Required
appTrafficRule list List of traffic rules. Max 16. No
> trafficRuleId string Traffic rule ID. Yes
> filterType enum {FLOW, PACKET} Filter type. Yes
> priority number (1 ~ 256) Priority of the traffic rule. If any conflict in the traffic rules, then higher the priority higher the precedence. Yes
> trafficFilter list List of traffic filters. Max 16. No
>> srcAddress list List of source ip address. Max 64. No
>> dstAddress list List of destination ip address. Max 64. No
>> srcPort list List of source port address. No
>> dstPort list List of destination port address. No
>> protocol list List of protocols. Max 8. Yes
>> tag list List of tags. Max 8. Yes
>> srcTunnelAddress list List of source tunnel address. No
>> tgtTunnelAddress list List of target tunnel address. No
>> srcTunnelPort list List of source tunnel ports. No
>> dstTunnelPort list List of destination tunnel ports. No
>> qCI number Match packets with same QCI. No
>> dSCP number Match packets with same DSCP. No
>> tC number Match packets with same TC. No
> action enum {DROP, FORWARD_DECAPSULATED, FORWARD_AS_IS, PASSTHROUGH, DUPLICATE_DECAPSULATED, DUPLICATE_AS_IS} Action when traffic rule matches. Yes
> dstInterface list Destination interface parameters. Max 2. No
>> interfaceType enum {TUNNEL, MAC, IP} Match packets with same TC. Yes
>> tunnelInfo object Tunnel parameters. No
>>> tunnelType enum {GTP_U, GRE} Tunnel type. Yes
>>> tunnelDstAddress string Destination IP address. No
>>> tunnelSrcAddress string Source IP address. No
>> srcMacAddress string Source MAC address No
>> dstMacAddress string Destination MAC address. No
>> dstIpAddress string Destination IP address. No
> state enum {ACTIVE, INACTIVE} State of the rule. No
appDNSRule list List of DNS rules. Max 32. No
> dnsRuleId string DNS rule ID. Yes
> domainName string Domain name. Yes
> ipAddressType enum {IPv4, IPv6} IP address type. Yes
> ipAddress string IP address. Yes
> ttl number Time To Live value. Yes
> state enum {ACTIVE, INACTIVE} Rule state. Yes
appSupportMp1 bool Whether Mp1 interface is supported. No
appName string Application name. Yes

Example Request:

PUT /mepcfg/app_lcm/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/appd_configuration
{
  "appTrafficRule": [
    {
      "trafficRuleId": "TrafficRule1",
      "filterType": "FLOW",
      "priority": 1,
      "trafficFilter": [
        {
          "srcAddress": [
            "192.158.1.1/28"
          ],
          "dstAddress": [
            "192.168.1.1/28"
          ],
          "srcPort": [
            "8080"
          ],
          "dstPort": [
            "8080"
          ],
          "protocol": [
            "TCP"
          ],
          "qCI": 1,
          "dSCP": 0,
          "tC": 1
        }
      ],
      "action": "DROP",
      "state": "ACTIVE"
    }
  ],
  "appDNSRule": [
    {
      "dnsRuleId": "dnsRule1",
      "domainName": "facerecgservice.com",
      "ipAddressType": "IP_V4",
      "ipAddress": "192.168.147.240",
      "ttl": 30,
      "state": "ACTIVE"
    }
  ],
  "appSupportMp1": true,
  "appName": "abc1"
}

Return Parameters:

Name Type Description
taskId string Task ID
appInstanceId string Application instance ID
configResult string Configuration result
configPhase string Progress percentage
Detailed string Detailed reason

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
{
  "taskId": "d464dd0a-d927-4baf-bc2c-d902fb0b2c73",
  "appInstanceId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
  "configResult": "PROCESSING",
  "configPhase": "0",
  "Detailed": "Operation In progress"
}

4. Delete appd configuration

Delete appd configuration request.

URL

DELETE /mepcfg/app_lcm/v1/applications/{appInstanceId}/appd_configuration

Request parameters:

Name Type Description IN Required
appInstanceId String APP实例ID(UUID) path Yes

Body parameters:

None

Example Request:

DELETE /mepcfg/app_lcm/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/appd_configuration

Return Parameters:

Name Type Description
taskId string Task ID
appInstanceId string Application instance ID
configResult string Configuration result
configPhase string Progress percentage
Detailed string Detailed reason

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
{
  "taskId": "d464dd0a-d927-4baf-bc2c-d902fb0b2c73",
  "appInstanceId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
  "configResult": "PROCESSING",
  "configPhase": "0",
  "Detailed": "Operation In progress"
}

5. Query task status

Once the appd configuration create, modify or delete is submitted, mep will create a task and return a task id to the caller and the caller can periodically check the status of the task using this id. This interface calls the mep for the task status.

URL

GET /mepcfg/app_lcm/v1/tasks/{taskId}/appd_configuration

Request parameters:

Name Type Description IN Required
taskId String Task ID(UUID) path Yes

Body parameters:

None

Example Request:

GET /mepcfg/app_lcm/v1/tasks/d464dd0a-d927-4baf-bc2c-d902fb0b2c73/appd_configuration

Return Parameters:

Name Type Description
taskId string Task ID
appInstanceId string Application instance ID
configResult string Configuration result
configPhase string Progress percentage
Detailed string Detailed reason

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
{
  "taskId": "d464dd0a-d927-4baf-bc2c-d902fb0b2c73",
  "appInstanceId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f",
  "configResult": "SUCCESS",
  "configPhase": "100",
  "Detailed": ""
}

Application Termination

MEP support termination/stop of instance of an application after MEP receive the request from MECM.

1. App Instance Termination

Interface to remove the application’s ak/sk values, unregister the services and delete the DNS and traffic rule.

URL

DELETE /mep/mec_app_support/v1/applications/{appInstanceId}/AppInstanceTermination

Request parameters:

Request parameters:

Name Type Description IN Required
appInstanceId String APP实例ID(UUID) path Yes
appInstanceId String APP实例ID(UUID) header Yes

Example Request:

DELETE /mep/mec_app_support/v1/applications/5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f/AppInstanceTermination

Body parameters:

None

Return Code: 200 OK

Example Response:

""

Query Platform Capabilities(Services)

MEP supports for querying the capabilities(services) registered with it. These capability information will be used by the MECM to display it to the user on its portal. MECM send the capability query to MEP over Mm5 interface.

1. Query all capabilities

Interface to query all capabilities. This interface return the capability list registered to the queried MEP server along with the consumers of it.

URL

GET /mepcfg/mec_platform_config/v1/capabilities

Request parameters:

None

Body parameters:

None

Example Request:

GET /mepcfg/mec_platform_config/v1/capabilities

Return Parameters:

Name Type Description
capabilityId String Capability/Service id
capabilityName String Capability/Service name
status Enum {ACTIVE, INACTIVE} Status
version String Version info
consumers Array[Object] Consumer object list
>applicationInstanceId String Consumer application id

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
[
    {
        "capabilityId": "16384563dca094183778a41ea7701d15",
        "capabilityName": "FaceRegService",
        "status": "ACTIVE",
        "version": "4.5.8",
        "consumers": [
            {
                "applicationInstanceId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f"
            },
            {
                "applicationInstanceId": "f05a5591-d8f2-4f89-8c0b-8cea6d45712e"
            },
            {
                "applicationInstanceId": "86dfc97d-325e-4feb-ac4f-280a0ba42513"
            }
        ]
    },
    {
        "capabilityId": "f7e898d1c9ea9edd05e1181bc09afc5e",
        "capabilityName": "Location",
        "status": "ACTIVE",
        "version": "v1.19",
        "consumers": [
            {
                "applicationInstanceId": "88922760-861b-4578-aae5-77b8fcb06142"
            }
        ]
    }
]

2. Query individual capability

Interface to query an individual capability from MEP. This interface return a capability along with the consumers of it.

URL

GET /mepcfg/mec_platform_config/v1/capabilities/{capabilityId}

Request parameters:

Name Type Description IN Required
capabilityId String Capability ID(UUID) path Yes

Body parameters:

None

Example Request:

GET /mepcfg/mec_platform_config/v1/capabilities/16384563dca094183778a41ea7701d15

Return Parameters:

Name Type Description
capabilityId String Capability/Service id
capabilityName String Capability/Service name
status Enum {ACTIVE, INACTIVE} Status
version String Version info
consumers Array[Object] Consumer object list
>applicationInstanceId String Consumer application id

Return Code: 200 OK

Example Response:

HTTP/1.1 200 OK
{
    "capabilityId": "16384563dca094183778a41ea7701d15",
    "capabilityName": "FaceRegService",
    "status": "ACTIVE",
    "version": "4.5.8",
    "consumers": [
        {
            "applicationInstanceId": "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f"
        },
        {
            "applicationInstanceId": "f05a5591-d8f2-4f89-8c0b-8cea6d45712e"
        },
        {
            "applicationInstanceId": "86dfc97d-325e-4feb-ac4f-280a0ba42513"
        }
    ]
}

异常状态码

|HTTP状态码|描述| |—|—| |400|错误的请求,用来表示请求的参数不正确。| |401|当前请求需要鉴权认证。| |403|禁止当前操作。| |404|请求的资源未被发现。| |412|请求中的先决条件验证失败。| |414|请求的URI超长,服务器拒绝处理请求。| |500|内部服务器错误。| |503|服务不可用。|

Dns-Server

Mep has a programmable dns server which can perform the name resolution of the MEC applications. This management interface of the dns server is handled using a rest interface and this section cover the details of this interface.

1. Create/Set new entry

DNS entry can be added or modified using this interface. Once a record is added/modified, the resource will be available for the device application to query.

Using this interface multiple records on multiple zones can be submitted together.

URL

PUT /mep/dns_server_mgmt/v1/rrecord

Request parameters:

None

Body parameters:

Name Type Description Required
zone string Zone name Yes
name string Domain name Yes
type enum {A, AAAA} DNS resource type, A in case of Ipv4 and AAAA for Ipv6 Yes
class enum {IN} Resource record class Yes on create
ttl int (non-zero value) Record TTL value Yes on create
rData list(string) IP Address list, Ip type must match with the type field Yes on create

Example Request:

PUT /mep/dns_server_mgmt/v1/rrecord
[
  {
    "zone": ".",
    "rr": [
      {
        "name": "www.example.com.",
        "type": "A",
        "class": "IN",
        "ttl": 30,
        "rData": [
          "172.168.15.101"
        ]
      }
    ]
  }
]

Return Parameters:

None

Return Code: 200 Success

Example Response:

HTTP/1.1 200 Success

2. Delete an entry

DNS entry can be deleted from the dns-server using this interface.

URL

DELETE /mep/dns_server_mgmt/v1/rrecord/{fqdn}/{rrtype}

Request parameters:

Name Type Description IN Required
fqdn String Fully Qualified Domain Name path Yes
rrtype String Resource record type of the entry(A or AAAA). path Yes

Body parameters:

None

Example Request:

DELETE /mep/dns_server_mgmt/v1/rrecord/www.example.com./A

Return Parameters:

None

Return Code: 200 Success

Example Response:

HTTP/1.1 200 Success

MEP Agent

Mep agent is a component which run as side car with application. It helps to get authenticaion token, do service registration, send heartbeat on behalf of application.

1. Get token

Applicaiontion can call this API to get authentication token from mepauth. URL

GET /mep-agent/v1/token

Request parameters:

Name Type Description IN Required
Content-Type String MIME type, fill in "application/json" header Yes

Body parameters:

None

Example request:

GET /mep-agent/v1/token

{
  "header": [
    {
      "key": "Content-Type",
      "value": "application/json"
    }
  ]
}

Return parameters:

Return code: 200 OK

Name Type Description Required
access_token String Token Yes
token_type String Token Type(Bearer) Yes
expires_in int Expire time Yes

Return example:

HTTP/1.1 200 OK
{
	"access_token":"xxxx",
	"token_type":"Bearer",
	"expires_in":"3600"
}

2. Get producer endpoint by service name

Applicaiontion can call this API to get producer endpoint from mepserver. URL

GET /mep-agent/v1/endpoint/:serName

Request parameters:

Name Type Description IN Required
Content-Type String MIME type, fill in "application/json" header Yes
serName String service name path Yes

Body parameters:

None

Example request:

GET /mep-agent/v1/endpoint/serviceName

{
  "header": [
    {
      "key": "Content-Type",
      "value": "application/json"
    }
  ]
}

Return parameters:

Return code: 200 OK

Name Type Description Required
endpoint Object endpoint Yes
>uris Array[String] URI格式的服务入口信息列表 Yes
>addresses Array[Object] 服务入口信息地址列表(IP地址+端口号) No
>>host String IP地址 No
>>port String 端口号 No
>alternative String 已实现格式或者外部规范定义的服务入口信息 No

Return example:

HTTP/1.1 200 OK
{
    "endpoint": {
        "uris": [
            "https://mep-api-gw.mep:8443/VideoService145da803354a611ebb15e"
        ],
        "addresses": null,
        "alternative": null
    }
}