From 6e4de84c9d70fb5b5576a4eda751c95be0dd11c9 Mon Sep 17 00:00:00 2001 From: featherstone Date: Fri, 15 Mar 2019 15:41:24 +0000 Subject: [PATCH] Sepeated ServiceInfo POST message body Signed-off-by: featherstone --- .vscode/settings.json | 3 ++ Mp1.json | 83 +++++++++++++++++++++++++++++++++++++++++-- Mp1.yaml | 59 ++++++++++++++++++++++++++---- 3 files changed, 137 insertions(+), 8 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3b66410 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "git.ignoreLimitWarning": true +} \ No newline at end of file diff --git a/Mp1.json b/Mp1.json index 001a744..8b104e6 100644 --- a/Mp1.json +++ b/Mp1.json @@ -338,7 +338,7 @@ } }, "requestBody": { - "$ref": "#/components/requestBodies/Services" + "$ref": "#/components/requestBodies/Services.Post" } } }, @@ -1130,6 +1130,7 @@ "ServiceInfo.TransportId": { "description": "Identifier of the platform-provided transport to be used by the service. Valid identifiers may be obtained using the \"Transport information query\" procedure. May be present in POST requests to signal the use of a platform-provided transport for the service, and shall be absent otherwise.", "type": "string", + "writeOnly": true, "example": "Rest1" }, "ServiceInfo.Version": { @@ -1147,7 +1148,7 @@ "type": "boolean", "example": true }, - "ServiceInfo": { + "ServiceInfo.Post": { "description": "This type represents the general information of a mobile edge service.", "type": "object", "required": [ @@ -1156,6 +1157,18 @@ "state", "serializer" ], + "oneOf": [ + { + "required": [ + "transportId" + ] + }, + { + "required": [ + "transportInfo" + ] + } + ], "properties": { "serInstanceId": { "$ref": "#/components/schemas/ServiceInfo.SerInstanceId" @@ -1192,6 +1205,49 @@ } } }, + "ServiceInfo": { + "description": "This type represents the general information of a mobile edge service.", + "type": "object", + "required": [ + "serName", + "version", + "state", + "transportInfo", + "serializer" + ], + "properties": { + "serInstanceId": { + "$ref": "#/components/schemas/ServiceInfo.SerInstanceId" + }, + "serName": { + "$ref": "#/components/schemas/ServiceInfo.SerName" + }, + "serCategory": { + "$ref": "#/components/schemas/CategoryRef" + }, + "version": { + "$ref": "#/components/schemas/ServiceInfo.Version" + }, + "state": { + "$ref": "#/components/schemas/ServiceInfo.State" + }, + "transportInfo": { + "$ref": "#/components/schemas/TransportInfo" + }, + "serializer": { + "$ref": "#/components/schemas/SerializerTypes" + }, + "scopeOfLocality": { + "$ref": "#/components/schemas/LocalityTypes" + }, + "consumedLocalOnly": { + "$ref": "#/components/schemas/ServiceInfo.ConsumedLocalOnly" + }, + "isLocal": { + "$ref": "#/components/schemas/ServiceInfo.IsLocal" + } + } + }, "Subscription": { "description": "A link to the related subscription", "type": "object", @@ -2098,6 +2154,11 @@ } } } + }, + "links": { + "getTransportInfo": { + "$ref": "#/components/links/GetTransportInfo" + } } }, "Error.400": { @@ -2208,6 +2269,17 @@ "description": "New ServiceInfo with updated \"state\" is included as entity body of the request", "required": true }, + "Services.Post": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceInfo.Post" + } + } + }, + "description": "New ServiceInfo with updated \"state\" is included as entity body of the request", + "required": true + }, "ServicesServiceId": { "content": { "application/json": { @@ -2313,6 +2385,13 @@ "trafficRuleId": "$response.body#/trafficRuleId" } }, + "GetTransportInfo": { + "operationId": "AppServices_POST", + "description": "The `id` value returned in the response can be used as the `transportId` parameter in `POST /applications/{appInstanceId}/services`. The first transport is provided as the link as wildcards are not supported", + "parameters": { + "transportId": "$response.body#/0/id" + } + }, "GetIndividualMeMp1Subscription": { "operationId": "ApplicationsSubscription_GET", "description": "The `subscriptionId` value returned in the response can be used as the `subscriptionId` parameter in `GET /applications/{appInstanceId}/subscriptions/{subscriptionType}/{subscriptionId}`", diff --git a/Mp1.yaml b/Mp1.yaml index e2f169a..5a3ebd1 100644 --- a/Mp1.yaml +++ b/Mp1.yaml @@ -232,7 +232,7 @@ paths: '404': $ref: '#/components/responses/Error.404' requestBody: - $ref: '#/components/requestBodies/Services' + $ref: '#/components/requestBodies/Services.Post' '/applications/{appInstanceId}/services/{serviceId}': parameters: - $ref: '#/components/parameters/Path.AppInstanceId' @@ -308,10 +308,6 @@ paths: $ref: '#/components/responses/Error.403' '404': $ref: '#/components/responses/Error.404' - - - - '/timing/current_time': get: description: >- @@ -867,6 +863,7 @@ components: platform-provided transport for the service, and shall be absent otherwise. type: string + writeOnly: true example: 'Rest1' ServiceInfo.Version: description: Service version @@ -885,7 +882,7 @@ components: by scopeOfLocality) as the consuming MEC application. type: boolean example: true - ServiceInfo: + ServiceInfo.Post: description: This type represents the general information of a mobile edge service. type: object required: @@ -893,6 +890,9 @@ components: - version - state - serializer + oneOf: + - required: [transportId] + - required: [transportInfo] properties: serInstanceId: $ref: '#/components/schemas/ServiceInfo.SerInstanceId' @@ -914,6 +914,36 @@ components: $ref: '#/components/schemas/LocalityTypes' consumedLocalOnly: $ref: '#/components/schemas/ServiceInfo.ConsumedLocalOnly' + isLocal: + $ref: '#/components/schemas/ServiceInfo.IsLocal' + ServiceInfo: + description: This type represents the general information of a mobile edge service. + type: object + required: + - serName + - version + - state + - transportInfo + - serializer + properties: + serInstanceId: + $ref: '#/components/schemas/ServiceInfo.SerInstanceId' + serName: + $ref: '#/components/schemas/ServiceInfo.SerName' + serCategory: + $ref: '#/components/schemas/CategoryRef' + version: + $ref: '#/components/schemas/ServiceInfo.Version' + state: + $ref: '#/components/schemas/ServiceInfo.State' + transportInfo: + $ref: '#/components/schemas/TransportInfo' + serializer: + $ref: '#/components/schemas/SerializerTypes' + scopeOfLocality: + $ref: '#/components/schemas/LocalityTypes' + consumedLocalOnly: + $ref: '#/components/schemas/ServiceInfo.ConsumedLocalOnly' isLocal: $ref: '#/components/schemas/ServiceInfo.IsLocal' Subscription: @@ -1637,6 +1667,9 @@ components: minItems: 0 items: $ref: '#/components/schemas/TransportInfo' + links: + getTransportInfo: + $ref: '#/components/links/GetTransportInfo' Error.400: description: Bad Request content: @@ -1705,6 +1738,15 @@ components: New ServiceInfo with updated "state" is included as entity body of the request required: true + Services.Post: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceInfo.Post' + description: >- + New ServiceInfo with updated "state" is included as entity body of the + request + required: true ServicesServiceId: content: application/json: @@ -1774,6 +1816,11 @@ components: description: The `trafficRuleId` value returned in the response can be used as the `trafficRuleId` parameter in `PUT /applications/{appInstanceId}/traffic_rules/{trafficRuleId}` parameters: trafficRuleId: '$response.body#/trafficRuleId' + GetTransportInfo: + operationId: AppServices_POST + description: The `id` value returned in the response can be used as the `transportId` parameter in `POST /applications/{appInstanceId}/services`. The first transport is provided as the link as wildcards are not supported + parameters: + transportId: '$response.body#/0/id' GetIndividualMeMp1Subscription: operationId: ApplicationsSubscription_GET description: The `subscriptionId` value returned in the response can be used as the `subscriptionId` parameter in `GET /applications/{appInstanceId}/subscriptions/{subscriptionType}/{subscriptionId}` -- GitLab