From 6063b2360ed2acc67e409475ba3ff882b0d89fb2 Mon Sep 17 00:00:00 2001 From: Mubeena Date: Mon, 4 Sep 2023 12:06:44 +0500 Subject: [PATCH 1/8] add OAS for MEC040_Federation Enablement APIs --- MEC040_fedEnablement.json | 549 ++++++++++++++++++++++++++++++++++++++ MEC040_fedEnablement.yaml | 384 ++++++++++++++++++++++++++ 2 files changed, 933 insertions(+) create mode 100644 MEC040_fedEnablement.json create mode 100644 MEC040_fedEnablement.yaml diff --git a/MEC040_fedEnablement.json b/MEC040_fedEnablement.json new file mode 100644 index 0000000..dbe3f26 --- /dev/null +++ b/MEC040_fedEnablement.json @@ -0,0 +1,549 @@ +{ + "openapi": "3.1.0", + "info": { + "contact": { + "url": "https://forge.etsi.org/rep/mec/gs040-fed-enablement-api" + }, + "version": "3.1.1", + "title": "ETSI GS MEC 040 - MEC Federation enablement APIs", + "description": "The ETSI MEC ISG MEC040 Federation enablement APIs described using OpenAPI", + "license": { + "name": "BSD-3-Clause", + "url": "https://forge.etsi.org/legal-matters" + } + }, + "externalDocs": { + "description": "ETSI GS MEC 040 Federation enablement API, v3.1.1", + "url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/040/03.01.01_60/gs_mec040v030101p.pdf" + }, + "servers": [ + { + "url": "https://localhost/fed-enablement/v1" + } + ], + "paths": { + "/fed_resources/system_info": { + "get": { + "summary": "Retrieve a list of system_info resources (see clause 6 for data model) of federation members.", + "description": "The GET method retrieves the information of a list of system_info resources of federation members. This method is typically used in the sequence of \"MEC system discovery\" as described in clause 5.2.2.2. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.3.3.1-1 and 7.3.3.1-2.", + "operationId": "systeminfoGET", + "tags": [ + "systemInfo" + ], + "parameters": [ + { + "$ref": "#/components/parameters/Query.Systemid" + }, + { + "$ref": "#/components/parameters/Query.Systemname" + }, + { + "$ref": "#/components/parameters/Query.Systemprovider" + } + ], + "responses": { + "200": { + "description": "It is used to indicate that the query for retrieving system_info resource(s) is successful. Response body containing one or multiple system_info resources shall be returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "post": { + "summary": "Create new system_info resource for a given MEC system.", + "description": "The POST method creates the information of system_info resources to the MEC federator. This method is typically used in the sequence of \"Registration of MEC system to the federation\" as described in clause 5.2.2.1. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.3.3.4-1 and 7.3.3.4-2.", + "operationId": "systeminfoPOST", + "tags": [ + "systemInfo" + ], + "requestBody": { + "description": "Entity body in the request contains SystemInfo to be created. The attribute \"systemId\" shall be absent.", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SystemInfo": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "It is used to indicate that the system_info resource is successfully created.\n\nThe HTTP response includes a \"Location\" HTTP header that contains the URI of the created resource.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SystemInfo": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/fed_resources/system_info/{systemId}": { + "get": { + "summary": "Retrieve the system_info resource of the federation member with systemId as its system identifier.", + "description": "The GET method retrieves the system_info resource information. This method is typically used in the sequence of \"MEC system discovery\" as described in clause 5.2.2.2. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.4.3.1-1 and 7.4.3.1-2.", + "operationId": "systeminfoByIdGET", + "tags": [ + "systemInfo" + ], + "parameters": [ + { + "$ref": "#/components/parameters/Query.Systemid" + } + ], + "responses": { + "200": { + "description": "It is used to indicate that the query for retrieving system_info resource is successful. Response body containing one system_info resource shall be returned.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SystemInfo": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "patch": { + "summary": "Update the system_info resource for a given MEC system.", + "description": "The PATCH method updates the information of system_info resources stored in the MEC federator through previous registration. This method is typically used in the sequence of \"Update of MEC system to the federation\" as described in clause 5.2.2.2. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.4.3.3-1 and 7.4.3.3-2.", + "operationId": "systeminfoByIdPATCH", + "tags": [ + "systemInfo" + ], + "parameters": [ + { + "$ref": "#/components/parameters/Query.Systemid" + } + ], + "requestBody": { + "description": "It contains attributes to be update.", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SystemInfoUpdate": { + "$ref": "#/components/schemas/SystemInfoUpdate" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "It is used to indicate that the system_info resource is successfully updated.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SystemInfo": { + "$ref": "#/components/schemas/SystemInfo" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "delete": { + "summary": "Delete the system_info resource for a given MEC system.", + "description": "The DELETE method deletes the information of system_info resources stored in the MEF. This method is typically used in the sequence of \"Deregistration of MEC system to the federation\" as described in clause 5.2.2.1.1. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.4.3.5-1 and 7.4.3.5-2.", + "operationId": "systeminfoByIdDELETE", + "tags": [ + "systemInfo" + ], + "parameters": [ + { + "$ref": "#/components/parameters/Query.Systemid" + } + ], + "responses": { + "204": { + "$ref": "#/components/responses/204" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + } + }, + "components": { + "schemas": { + "ProblemDetails": { + "type": "object", + "properties": { + "type": { + "type": "string", + "format": "uri", + "description": "A URI reference according to IETF RFC 3986 that identifies the problem type" + }, + "title": { + "type": "string", + "description": "A short, human-readable summary of the problem type" + }, + "status": { + "type": "integer", + "format": "uint32", + "description": "The HTTP status code for this occurrence of the problem" + }, + "detail": { + "type": "string", + "description": "A human-readable explanation specific to this occurrence of the problem", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "instance": { + "type": "string", + "format": "uri", + "description": "A URI reference that identifies the specific occurrence of the problem" + } + } + }, + "SystemInfo": { + "title": "SystemInfo", + "type": "object", + "description": "This type represents an information provided by the MEC orchestrator as a part of the \"Registration of MEC system to the federation\"", + "properties": { + "systemId": { + "description": "Identifier of the MEC system. For the uniqueness of the identifier across the federated MEC systems, UUID format [i.9] is recommended. Shall be absent in POST request, and present otherwise.", + "type": "string" + }, + "systemName": { + "description": "The name of the MEC system. This is how the MEC system identifies other MEC systems", + "type": "string" + }, + "systemProvider": { + "description": "Provider of the MEC system.", + "type": "string" + } + }, + "required": [ + "systemId", + "systemName", + "systemProvider" + ] + }, + "SystemInfoUpdate": { + "title": "SystemInfoUpdate", + "type": "object", + "description": "This type represents an information provided by MEC orchestrator as a part of the \"Update of MEC system(s) to the federation\".", + "properties": { + "systemName": { + "description": "The name of the MEC system. This is how the MEC system identifies other MEC systems.", + "type": "string" + }, + "endpoint": { + "$ref": "#/components/schemas/EndPointInfo", + "NOTE": "At least one attribute shall exist." + } + } + }, + "EndPointInfo": { + "title": "EndPointInfo", + "type": "string", + "description": "Endpoint information (e.g. URI, FQDN, IP address) of MEC federator." + }, + "SystemUpdateNotificationSubscription": { + "title": "SystemUpdateNotificationSubscription", + "type": "object", + "description": "This type represents a subscription to the notifications from the MEC federator related to information update of the MEC systems in the MEC federation.", + "properties": { + "subscriptionType": { + "description": "Shall be set to \"SystemUpdateNotificationSubscription\".", + "type": "string" + }, + "callbackReference": { + "description": "URI selected by the MEC orchestrator to receive notifications on the subscribed MEC system information updates in the MEC federation. This shall be included in both the request and the response.", + "type": "string", + "format": "uri" + }, + "links": { + "$ref": "#/components/schemas/links" + }, + "systemId": { + "description": "Identifier(s) to uniquely specify the target MEC system(s) for the subscription. If absent, the subscription should include all MEC systems in the MEC federation.", + "type": "array", + "minItems": 0, + "items": { + "type": "string" + } + }, + "expiryDeadline": { + "$ref": "#/components/schemas/TimeStamp" + } + }, + "required": [ + "subscriptionType", + "callbackReference" + ] + }, + "SystemUpdateNotification": { + "title": "SystemUpdateNotification", + "type": "object", + "description": "This type represents the information that the MEC federator notifies the subscribed MEC orchestrator about the information update of the MEC systems in the MEC federation.", + "properties": { + "notificationType": { + "description": "Shall be set to \"SystemUpdateNotification\".", + "type": "string" + }, + "updatedSystemInfo": { + "description": "Updated information of the MEC system(s) in the MEC federation.", + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/components/schemas/SystemInfo" + } + }, + "links": { + "$ref": "#/components/schemas/links1" + } + }, + "required": [ + "notificationType", + "updatedSystemInfo", + "links" + ] + }, + "TimeStamp": { + "title": "TimeStamp", + "type": "object", + "description": "The expiration time of the subscription determined by the MEC Federation Enablement Service.", + "properties": { + "seconds": { + "description": "The seconds part of the time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC.", + "type": "integer", + "format": "uint32" + }, + "nanoSeconds": { + "description": "The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", + "type": "integer", + "format": "uint32" + } + }, + "required": [ + "seconds", + "nanoSeconds" + ] + }, + "links": { + "title": "links", + "description": "Object containing hyperlinks related to the resource. This shall only be included in the HTTP responses.", + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/LinkType" + } + }, + "required": [ + "self" + ] + }, + "links1": { + "title": "links1", + "description": "Object containing hyperlinks related to the resource.", + "type": "object", + "properties": { + "subscription": { + "$ref": "#/components/schemas/LinkType" + } + }, + "required": [ + "subscription" + ] + }, + "LinkType": { + "title": "LinkType", + "description": "Self-referring URI. The URI shall be unique within the MEC Federation Enablement API as it acts as an ID for the subscription (SubscriptionId).", + "type": "object", + "properties": { + "href": { + "description": "URI referring to a resource.", + "format": "uri", + "type": "string" + } + }, + "required": [ + "href" + ] + } + }, + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request: used to indicate that incorrect parameters were passed to the request.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized: used when the client did not submit credentials.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "Forbidden: operation is not allowed given the current status of the resource.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Not Found: used when a client provided a URI that cannot be mapped to a valid resource URI.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + }, + "parameters": { + "Query.Systemid": { + "description": "Identifier of the MEC system.", + "name": "systemid", + "in": "query", + "required": false, + "x-exportParamName": "Query.Systemid", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Query.Systemname": { + "description": "The name of the MEC system.", + "name": "systemname", + "in": "query", + "required": false, + "x-exportParamName": "Query.Systemname", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Query.Systemprovider": { + "description": "Provider of the MEC system.", + "name": "systemprovider", + "in": "query", + "required": false, + "x-exportParamName": "Query.Systemprovider", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/MEC040_fedEnablement.yaml b/MEC040_fedEnablement.yaml new file mode 100644 index 0000000..6be7914 --- /dev/null +++ b/MEC040_fedEnablement.yaml @@ -0,0 +1,384 @@ +openapi: 3.1.0 +info: + contact: + url: https://forge.etsi.org/rep/mec/gs040-fed-enablement-api + version: 3.1.1 + title: ETSI GS MEC 040 - MEC Federation enablement APIs + description: The ETSI MEC ISG MEC040 Federation enablement APIs described using OpenAPI + license: + name: BSD-3-Clause + url: 'https://forge.etsi.org/legal-matters' +externalDocs: + description: ETSI GS MEC 040 Federation enablement API, v3.1.1 + url: https://www.etsi.org/deliver/etsi_gs/MEC/001_099/040/03.01.01_60/gs_mec040v030101p.pdf +servers: +- url: https://localhost/fed-enablement/v1 + +paths: + /fed_resources/system_info: + get: + summary: Retrieve a list of system_info resources (see clause 6 for data model) of federation members. + description: The GET method retrieves the information of a list of system_info resources of federation members. This method is typically used in the sequence of "MEC system discovery" as described in clause 5.2.2.2. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.3.3.1-1 and 7.3.3.1-2. + operationId: systeminfoGET + tags: + - systemInfo + parameters: + - $ref: '#/components/parameters/Query.Systemid' + - $ref: '#/components/parameters/Query.Systemname' + - $ref: '#/components/parameters/Query.Systemprovider' + responses: + '200': + description: It is used to indicate that the query for retrieving system_info resource(s) is successful. Response body containing one or multiple system_info resources shall be returned. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SystemInfo' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '403': + $ref: '#/components/responses/403' + '404': + $ref: '#/components/responses/404' + post: + summary: Create new system_info resource for a given MEC system. + description: "The POST method creates the information of system_info resources to the MEC federator. This method is typically used in the sequence of \"Registration of MEC system to the federation\" as described in clause 5.2.2.1. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables\_7.3.3.4-1 and 7.3.3.4-2." + operationId: systeminfoPOST + tags: + - systemInfo + requestBody: + description: Entity body in the request contains SystemInfo to be created. The attribute "systemId" shall be absent. + required: true + content: + application/json: + schema: + type: object + properties: + SystemInfo: + $ref: '#/components/schemas/SystemInfo' + responses: + '201': + description: 'It is used to indicate that the system_info resource is successfully created. + + + The HTTP response includes a "Location" HTTP header that contains the URI of the created resource.' + content: + application/json: + schema: + type: object + properties: + SystemInfo: + $ref: '#/components/schemas/SystemInfo' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '403': + $ref: '#/components/responses/403' + '404': + $ref: '#/components/responses/404' + /fed_resources/system_info/{systemId}: + get: + summary: Retrieve the system_info resource of the federation member with systemId as its system identifier. + description: The GET method retrieves the system_info resource information. This method is typically used in the sequence of "MEC system discovery" as described in clause 5.2.2.2. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.4.3.1-1 and 7.4.3.1-2. + operationId: systeminfoByIdGET + tags: + - systemInfo + parameters: + - $ref: '#/components/parameters/Query.Systemid' + responses: + '200': + description: It is used to indicate that the query for retrieving system_info resource is successful. Response body containing one system_info resource shall be returned. + content: + application/json: + schema: + type: object + properties: + SystemInfo: + $ref: '#/components/schemas/SystemInfo' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '403': + $ref: '#/components/responses/403' + '404': + $ref: '#/components/responses/404' + patch: + summary: Update the system_info resource for a given MEC system. + description: The PATCH method updates the information of system_info resources stored in the MEC federator through previous registration. This method is typically used in the sequence of "Update of MEC system to the federation" as described in clause 5.2.2.2. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.4.3.3-1 and 7.4.3.3-2. + operationId: systeminfoByIdPATCH + tags: + - systemInfo + parameters: + - $ref: '#/components/parameters/Query.Systemid' + requestBody: + description: It contains attributes to be update. + required: true + content: + application/json: + schema: + type: object + properties: + SystemInfoUpdate: + $ref: '#/components/schemas/SystemInfoUpdate' + responses: + '200': + description: It is used to indicate that the system_info resource is successfully updated. + content: + application/json: + schema: + type: object + properties: + SystemInfo: + $ref: '#/components/schemas/SystemInfo' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '403': + $ref: '#/components/responses/403' + '404': + $ref: '#/components/responses/404' + delete: + summary: Delete the system_info resource for a given MEC system. + description: The DELETE method deletes the information of system_info resources stored in the MEF. This method is typically used in the sequence of "Deregistration of MEC system to the federation" as described in clause 5.2.2.1.1. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.4.3.5-1 and 7.4.3.5-2. + operationId: systeminfoByIdDELETE + tags: + - systemInfo + parameters: + - $ref: '#/components/parameters/Query.Systemid' + responses: + '204': + $ref: '#/components/responses/204' + '400': + $ref: '#/components/responses/400' + '401': + $ref: '#/components/responses/401' + '403': + $ref: '#/components/responses/403' + '404': + $ref: '#/components/responses/404' +components: + schemas: + ProblemDetails: + type: object + properties: + type: + type: string + format: uri + description: A URI reference according to IETF RFC 3986 that identifies the problem type + title: + type: string + description: A short, human-readable summary of the problem type + status: + type: integer + format: uint32 + description: The HTTP status code for this occurrence of the problem + detail: + type: string + description: A human-readable explanation specific to this occurrence of the problem + x-etsi-mec-cardinality: 0..1 + x-etsi-mec-origin-type: String + instance: + type: string + format: uri + description: A URI reference that identifies the specific occurrence of the problem + SystemInfo: + title: SystemInfo + type: object + description: This type represents an information provided by the MEC orchestrator as a part of the "Registration of MEC system to the federation" + properties: + systemId: + description: 'Identifier of the MEC system. For the uniqueness of the identifier across the federated MEC systems, UUID format [i.9] is recommended. Shall be absent in POST request, and present otherwise.' + type: string + systemName: + description: The name of the MEC system. This is how the MEC system identifies other MEC systems + type: string + systemProvider: + description: Provider of the MEC system. + type: string + required: + - systemId + - systemName + - systemProvider + SystemInfoUpdate: + title: SystemInfoUpdate + type: object + description: This type represents an information provided by MEC orchestrator as a part of the "Update of MEC system(s) to the federation". + properties: + systemName: + description: The name of the MEC system. This is how the MEC system identifies other MEC systems. + type: string + endpoint: + # description': Endpoint information (e.g. URI, FQDN, IP address) of MEC federator. + $ref: '#/components/schemas/EndPointInfo' + # x-etsi-mec-origin-type': EndPointInfo + # x-etsi-mec-cardinality': 0..1 + NOTE: At least one attribute shall exist. + EndPointInfo: + title: EndPointInfo + type: string + description: Endpoint information (e.g. URI, FQDN, IP address) of MEC federator. + SystemUpdateNotificationSubscription: + title: SystemUpdateNotificationSubscription + type: object + description: This type represents a subscription to the notifications from the MEC federator related to information update of the MEC systems in the MEC federation. + properties: + subscriptionType: + description: Shall be set to "SystemUpdateNotificationSubscription". + type: string + callbackReference: + description: URI selected by the MEC orchestrator to receive notifications on the subscribed MEC system information updates in the MEC federation. This shall be included in both the request and the response. + type: string + format: uri + links: + $ref: '#/components/schemas/links' + systemId: + description: Identifier(s) to uniquely specify the target MEC system(s) for the subscription. If absent, the subscription should include all MEC systems in the MEC federation. + type: array + minItems: 0 + items: + type: string + expiryDeadline: + # description': The expiration time of the subscription determined by the MEC Federation Enablement Service. + $ref: '#/components/schemas/TimeStamp' + # x-etsi-mec-origin-type': TimeStamp + # x-etsi-mec-cardinality': 0..1 + required: + - subscriptionType + - callbackReference + SystemUpdateNotification: + title: SystemUpdateNotification + type: object + description: This type represents the information that the MEC federator notifies the subscribed MEC orchestrator about the information update of the MEC systems in the MEC federation. + properties: + notificationType: + description: Shall be set to "SystemUpdateNotification". + type: string + updatedSystemInfo: + description: Updated information of the MEC system(s) in the MEC federation. + type: array + minItems: 1 + items: + $ref: '#/components/schemas/SystemInfo' + links: + $ref: '#/components/schemas/links1' + required: + - notificationType + - updatedSystemInfo + - links + TimeStamp: + title: TimeStamp + type: object + description: The expiration time of the subscription determined by the MEC Federation Enablement Service. + properties: + seconds: + description: The seconds part of the time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC. + type: integer + format: uint32 + nanoSeconds: + description: The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC. + type: integer + format: uint32 + required: + - seconds + - nanoSeconds + links: + title: links + description: Object containing hyperlinks related to the resource. This shall only be included in the HTTP responses. + type: object + properties: + self: + #description': Self-referring URI. The URI shall be unique within the MEC Federation Enablement API as it acts as an ID for the subscription (SubscriptionId). + $ref: '#/components/schemas/LinkType' + # x-etsi-mec-origin-type': LinkType + # x-etsi-mec-cardinality': '1' + required: + - self + links1: + title: links1 + description: Object containing hyperlinks related to the resource. + type: object + properties: + subscription: + # description': A link to the related subscription. + $ref: '#/components/schemas/LinkType' + # x-etsi-mec-origin-type': LinkType + # x-etsi-mec-cardinality': '1' + required: + - subscription + LinkType: + title: LinkType + description: Self-referring URI. The URI shall be unique within the MEC Federation Enablement API as it acts as an ID for the subscription (SubscriptionId). + type: object + properties: + href: + description: URI referring to a resource. + format: uri + type: string + required: + - href + responses: + '200': + description: OK + '204': + description: No Content + '400': + description: 'Bad Request: used to indicate that incorrect parameters were passed to the request.' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '401': + description: 'Unauthorized: used when the client did not submit credentials.' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '403': + description: 'Forbidden: operation is not allowed given the current status of the resource.' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + '404': + description: 'Not Found: used when a client provided a URI that cannot be mapped to a valid resource URI.' + content: + application/problem+json: + schema: + $ref: '#/components/schemas/ProblemDetails' + parameters: + Query.Systemid: + description: Identifier of the MEC system. + name: systemid + in: query + required: false + x-exportParamName: Query.Systemid + schema: + type: array + items: + type: string + Query.Systemname: + description: The name of the MEC system. + name: systemname + in: query + required: false + x-exportParamName: Query.Systemname + schema: + type: array + items: + type: string + Query.Systemprovider: + description: Provider of the MEC system. + name: systemprovider + in: query + required: false + x-exportParamName: Query.Systemprovider + schema: + type: array + items: + type: string \ No newline at end of file -- GitLab From cd7bdd3c16212d1927c9a17933da05195010444e Mon Sep 17 00:00:00 2001 From: Mubeena Date: Mon, 4 Sep 2023 13:05:01 +0500 Subject: [PATCH 2/8] fix errors in OAS and json files --- MEC040_fedEnablement.json | 42 +++++++++++++++++--------------------- MEC040_fedEnablement.yaml | 43 ++++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 44 deletions(-) diff --git a/MEC040_fedEnablement.json b/MEC040_fedEnablement.json index dbe3f26..cd0abb7 100644 --- a/MEC040_fedEnablement.json +++ b/MEC040_fedEnablement.json @@ -1,12 +1,12 @@ { - "openapi": "3.1.0", + "openapi": "3.0.0", "info": { "contact": { "url": "https://forge.etsi.org/rep/mec/gs040-fed-enablement-api" }, "version": "3.1.1", "title": "ETSI GS MEC 040 - MEC Federation enablement APIs", - "description": "The ETSI MEC ISG MEC040 Federation enablement APIs described using OpenAPI", + "description": "The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI", "license": { "name": "BSD-3-Clause", "url": "https://forge.etsi.org/legal-matters" @@ -32,13 +32,13 @@ ], "parameters": [ { - "$ref": "#/components/parameters/Query.Systemid" + "$ref": "#/components/parameters/Query.systemId" }, { - "$ref": "#/components/parameters/Query.Systemname" + "$ref": "#/components/parameters/Query.systemName" }, { - "$ref": "#/components/parameters/Query.Systemprovider" + "$ref": "#/components/parameters/Query.systemProvider" } ], "responses": { @@ -133,7 +133,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/Query.Systemid" + "$ref": "#/components/parameters/Query.systemId" } ], "responses": { @@ -175,7 +175,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/Query.Systemid" + "$ref": "#/components/parameters/Query.systemId" } ], "requestBody": { @@ -233,7 +233,7 @@ ], "parameters": [ { - "$ref": "#/components/parameters/Query.Systemid" + "$ref": "#/components/parameters/Query.systemId" } ], "responses": { @@ -315,15 +315,14 @@ "SystemInfoUpdate": { "title": "SystemInfoUpdate", "type": "object", - "description": "This type represents an information provided by MEC orchestrator as a part of the \"Update of MEC system(s) to the federation\".", + "description": "This type represents an information provided by MEC orchestrator as a part of the\n\"Update of MEC system(s) to the federation\".\n\nNOTE: At least one attribute shall exist.\n", "properties": { "systemName": { "description": "The name of the MEC system. This is how the MEC system identifies other MEC systems.", "type": "string" }, "endpoint": { - "$ref": "#/components/schemas/EndPointInfo", - "NOTE": "At least one attribute shall exist." + "$ref": "#/components/schemas/EndPointInfo" } } }, @@ -457,9 +456,6 @@ } }, "responses": { - "200": { - "description": "OK" - }, "204": { "description": "No Content" }, @@ -505,12 +501,12 @@ } }, "parameters": { - "Query.Systemid": { + "Query.systemId": { "description": "Identifier of the MEC system.", - "name": "systemid", + "name": "systemId", "in": "query", "required": false, - "x-exportParamName": "Query.Systemid", + "x-exportParamName": "Query.systemId", "schema": { "type": "array", "items": { @@ -518,12 +514,12 @@ } } }, - "Query.Systemname": { + "Query.systemName": { "description": "The name of the MEC system.", - "name": "systemname", + "name": "systemName", "in": "query", "required": false, - "x-exportParamName": "Query.Systemname", + "x-exportParamName": "Query.systemName", "schema": { "type": "array", "items": { @@ -531,12 +527,12 @@ } } }, - "Query.Systemprovider": { + "Query.systemProvider": { "description": "Provider of the MEC system.", - "name": "systemprovider", + "name": "systemProvider", "in": "query", "required": false, - "x-exportParamName": "Query.Systemprovider", + "x-exportParamName": "Query.systemProvider", "schema": { "type": "array", "items": { diff --git a/MEC040_fedEnablement.yaml b/MEC040_fedEnablement.yaml index 6be7914..a35841d 100644 --- a/MEC040_fedEnablement.yaml +++ b/MEC040_fedEnablement.yaml @@ -1,10 +1,10 @@ -openapi: 3.1.0 +openapi: 3.0.0 info: contact: url: https://forge.etsi.org/rep/mec/gs040-fed-enablement-api version: 3.1.1 title: ETSI GS MEC 040 - MEC Federation enablement APIs - description: The ETSI MEC ISG MEC040 Federation enablement APIs described using OpenAPI + description: The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI license: name: BSD-3-Clause url: 'https://forge.etsi.org/legal-matters' @@ -23,9 +23,9 @@ paths: tags: - systemInfo parameters: - - $ref: '#/components/parameters/Query.Systemid' - - $ref: '#/components/parameters/Query.Systemname' - - $ref: '#/components/parameters/Query.Systemprovider' + - $ref: '#/components/parameters/Query.systemId' + - $ref: '#/components/parameters/Query.systemName' + - $ref: '#/components/parameters/Query.systemProvider' responses: '200': description: It is used to indicate that the query for retrieving system_info resource(s) is successful. Response body containing one or multiple system_info resources shall be returned. @@ -88,7 +88,7 @@ paths: tags: - systemInfo parameters: - - $ref: '#/components/parameters/Query.Systemid' + - $ref: '#/components/parameters/Query.systemId' responses: '200': description: It is used to indicate that the query for retrieving system_info resource is successful. Response body containing one system_info resource shall be returned. @@ -114,7 +114,7 @@ paths: tags: - systemInfo parameters: - - $ref: '#/components/parameters/Query.Systemid' + - $ref: '#/components/parameters/Query.systemId' requestBody: description: It contains attributes to be update. required: true @@ -150,7 +150,7 @@ paths: tags: - systemInfo parameters: - - $ref: '#/components/parameters/Query.Systemid' + - $ref: '#/components/parameters/Query.systemId' responses: '204': $ref: '#/components/responses/204' @@ -208,7 +208,11 @@ components: SystemInfoUpdate: title: SystemInfoUpdate type: object - description: This type represents an information provided by MEC orchestrator as a part of the "Update of MEC system(s) to the federation". + description: | + This type represents an information provided by MEC orchestrator as a part of the + "Update of MEC system(s) to the federation". + + NOTE: At least one attribute shall exist. properties: systemName: description: The name of the MEC system. This is how the MEC system identifies other MEC systems. @@ -218,7 +222,6 @@ components: $ref: '#/components/schemas/EndPointInfo' # x-etsi-mec-origin-type': EndPointInfo # x-etsi-mec-cardinality': 0..1 - NOTE: At least one attribute shall exist. EndPointInfo: title: EndPointInfo type: string @@ -323,8 +326,6 @@ components: required: - href responses: - '200': - description: OK '204': description: No Content '400': @@ -352,32 +353,32 @@ components: schema: $ref: '#/components/schemas/ProblemDetails' parameters: - Query.Systemid: + Query.systemId: description: Identifier of the MEC system. - name: systemid + name: systemId in: query required: false - x-exportParamName: Query.Systemid + x-exportParamName: Query.systemId schema: type: array items: type: string - Query.Systemname: + Query.systemName: description: The name of the MEC system. - name: systemname + name: systemName in: query required: false - x-exportParamName: Query.Systemname + x-exportParamName: Query.systemName schema: type: array items: type: string - Query.Systemprovider: + Query.systemProvider: description: Provider of the MEC system. - name: systemprovider + name: systemProvider in: query required: false - x-exportParamName: Query.Systemprovider + x-exportParamName: Query.systemProvider schema: type: array items: -- GitLab From 2004bc5a1d34abc4cebc3413a56b60b773c1baf4 Mon Sep 17 00:00:00 2001 From: Mubeena Date: Mon, 4 Sep 2023 13:26:44 +0500 Subject: [PATCH 3/8] fix errors in OAS and json files --- MEC040_fedEnablement.json | 1006 +++++++++++++++++++------------------ MEC040_fedEnablement.yaml | 14 +- 2 files changed, 519 insertions(+), 501 deletions(-) diff --git a/MEC040_fedEnablement.json b/MEC040_fedEnablement.json index cd0abb7..4027258 100644 --- a/MEC040_fedEnablement.json +++ b/MEC040_fedEnablement.json @@ -1,545 +1,555 @@ { "openapi": "3.0.0", "info": { - "contact": { - "url": "https://forge.etsi.org/rep/mec/gs040-fed-enablement-api" - }, - "version": "3.1.1", - "title": "ETSI GS MEC 040 - MEC Federation enablement APIs", - "description": "The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI", - "license": { - "name": "BSD-3-Clause", - "url": "https://forge.etsi.org/legal-matters" - } + "contact": { + "url": "https://forge.etsi.org/rep/mec/gs040-fed-enablement-api" + }, + "version": "3.1.1", + "title": "ETSI GS MEC 040 - MEC Federation enablement APIs", + "description": "The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI", + "license": { + "name": "BSD-3-Clause", + "url": "https://forge.etsi.org/legal-matters" + } }, "externalDocs": { - "description": "ETSI GS MEC 040 Federation enablement API, v3.1.1", - "url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/040/03.01.01_60/gs_mec040v030101p.pdf" + "description": "ETSI GS MEC 040 Federation enablement API, v3.1.1", + "url": "https://www.etsi.org/deliver/etsi_gs/MEC/001_099/040/03.01.01_60/gs_mec040v030101p.pdf" }, "servers": [ - { - "url": "https://localhost/fed-enablement/v1" - } + { + "url": "https://localhost/fed-enablement/v1" + } ], "paths": { - "/fed_resources/system_info": { - "get": { - "summary": "Retrieve a list of system_info resources (see clause 6 for data model) of federation members.", - "description": "The GET method retrieves the information of a list of system_info resources of federation members. This method is typically used in the sequence of \"MEC system discovery\" as described in clause 5.2.2.2. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.3.3.1-1 and 7.3.3.1-2.", - "operationId": "systeminfoGET", - "tags": [ - "systemInfo" - ], - "parameters": [ - { - "$ref": "#/components/parameters/Query.systemId" - }, - { - "$ref": "#/components/parameters/Query.systemName" - }, - { - "$ref": "#/components/parameters/Query.systemProvider" - } - ], - "responses": { - "200": { - "description": "It is used to indicate that the query for retrieving system_info resource(s) is successful. Response body containing one or multiple system_info resources shall be returned.", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SystemInfo" - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - } - } + "/fed_resources/system_info": { + "get": { + "summary": "Retrieve a list of system_info resources (see clause 6 for data model) of federation members.", + "description": "The GET method retrieves the information of a list of system_info resources of federation members. This method is typically used in the sequence of \"MEC system discovery\" as described in clause 5.2.2.2. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.3.3.1-1 and 7.3.3.1-2.", + "operationId": "systeminfoGET", + "tags": [ + "systemInfo" + ], + "parameters": [ + { + "$ref": "#/components/parameters/Query.systemId" }, - "post": { - "summary": "Create new system_info resource for a given MEC system.", - "description": "The POST method creates the information of system_info resources to the MEC federator. This method is typically used in the sequence of \"Registration of MEC system to the federation\" as described in clause 5.2.2.1. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.3.3.4-1 and 7.3.3.4-2.", - "operationId": "systeminfoPOST", - "tags": [ - "systemInfo" - ], - "requestBody": { - "description": "Entity body in the request contains SystemInfo to be created. The attribute \"systemId\" shall be absent.", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "SystemInfo": { - "$ref": "#/components/schemas/SystemInfo" - } - } - } - } - } - }, - "responses": { - "201": { - "description": "It is used to indicate that the system_info resource is successfully created.\n\nThe HTTP response includes a \"Location\" HTTP header that contains the URI of the created resource.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "SystemInfo": { - "$ref": "#/components/schemas/SystemInfo" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" + { + "$ref": "#/components/parameters/Query.systemName" + }, + { + "$ref": "#/components/parameters/Query.systemProvider" + } + ], + "responses": { + "200": { + "description": "It is used to indicate that the query for retrieving system_info resource(s) is successful. Response body containing one or multiple system_info resources shall be returned.", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SystemInfo" } + } } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" } + } }, - "/fed_resources/system_info/{systemId}": { - "get": { - "summary": "Retrieve the system_info resource of the federation member with systemId as its system identifier.", - "description": "The GET method retrieves the system_info resource information. This method is typically used in the sequence of \"MEC system discovery\" as described in clause 5.2.2.2. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.4.3.1-1 and 7.4.3.1-2.", - "operationId": "systeminfoByIdGET", - "tags": [ - "systemInfo" - ], - "parameters": [ - { - "$ref": "#/components/parameters/Query.systemId" - } - ], - "responses": { - "200": { - "description": "It is used to indicate that the query for retrieving system_info resource is successful. Response body containing one system_info resource shall be returned.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "SystemInfo": { - "$ref": "#/components/schemas/SystemInfo" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" + "post": { + "summary": "Create new system_info resource for a given MEC system.", + "description": "The POST method creates the information of system_info resources to the MEC federator. This method is typically used in the sequence of \"Registration of MEC system to the federation\" as described in clause 5.2.2.1. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.3.3.4-1 and 7.3.3.4-2.", + "operationId": "systeminfoPOST", + "tags": [ + "systemInfo" + ], + "requestBody": { + "description": "Entity body in the request contains SystemInfo to be created. The attribute \"systemId\" shall be absent.", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SystemInfo": { + "$ref": "#/components/schemas/SystemInfo" } + } } - }, - "patch": { - "summary": "Update the system_info resource for a given MEC system.", - "description": "The PATCH method updates the information of system_info resources stored in the MEC federator through previous registration. This method is typically used in the sequence of \"Update of MEC system to the federation\" as described in clause 5.2.2.2. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.4.3.3-1 and 7.4.3.3-2.", - "operationId": "systeminfoByIdPATCH", - "tags": [ - "systemInfo" - ], - "parameters": [ - { - "$ref": "#/components/parameters/Query.systemId" - } - ], - "requestBody": { - "description": "It contains attributes to be update.", - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "SystemInfoUpdate": { - "$ref": "#/components/schemas/SystemInfoUpdate" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "It is used to indicate that the system_info resource is successfully updated.", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "SystemInfo": { - "$ref": "#/components/schemas/SystemInfo" - } - } - } - } - } - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" + } + } + }, + "responses": { + "201": { + "description": "It is used to indicate that the system_info resource is successfully created.\n\nThe HTTP response includes a \"Location\" HTTP header that contains the URI of the created resource.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SystemInfo": { + "$ref": "#/components/schemas/SystemInfo" + } } + } } + } }, - "delete": { - "summary": "Delete the system_info resource for a given MEC system.", - "description": "The DELETE method deletes the information of system_info resources stored in the MEF. This method is typically used in the sequence of \"Deregistration of MEC system to the federation\" as described in clause 5.2.2.1.1. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.4.3.5-1 and 7.4.3.5-2.", - "operationId": "systeminfoByIdDELETE", - "tags": [ - "systemInfo" - ], - "parameters": [ - { - "$ref": "#/components/parameters/Query.systemId" - } - ], - "responses": { - "204": { - "$ref": "#/components/responses/204" - }, - "400": { - "$ref": "#/components/responses/400" - }, - "401": { - "$ref": "#/components/responses/401" - }, - "403": { - "$ref": "#/components/responses/403" - }, - "404": { - "$ref": "#/components/responses/404" - } - } + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" } + } } - }, - "components": { - "schemas": { - "ProblemDetails": { - "type": "object", - "properties": { - "type": { - "type": "string", - "format": "uri", - "description": "A URI reference according to IETF RFC 3986 that identifies the problem type" - }, - "title": { - "type": "string", - "description": "A short, human-readable summary of the problem type" - }, - "status": { - "type": "integer", - "format": "uint32", - "description": "The HTTP status code for this occurrence of the problem" - }, - "detail": { - "type": "string", - "description": "A human-readable explanation specific to this occurrence of the problem", - "x-etsi-mec-cardinality": "0..1", - "x-etsi-mec-origin-type": "String" - }, - "instance": { - "type": "string", - "format": "uri", - "description": "A URI reference that identifies the specific occurrence of the problem" + }, + "/fed_resources/system_info/{systemId}": { + "get": { + "summary": "Retrieve the system_info resource of the federation member with systemId as its system identifier.", + "description": "The GET method retrieves the system_info resource information. This method is typically used in the sequence of \"MEC system discovery\" as described in clause 5.2.2.2. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.4.3.1-1 and 7.4.3.1-2.", + "operationId": "systeminfoByIdGET", + "tags": [ + "systemInfo" + ], + "parameters": [ + { + "$ref": "#/components/parameters/Path.systemId" + } + ], + "responses": { + "200": { + "description": "It is used to indicate that the query for retrieving system_info resource is successful. Response body containing one system_info resource shall be returned.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SystemInfo": { + "$ref": "#/components/schemas/SystemInfo" + } } + } } + } + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" }, - "SystemInfo": { - "title": "SystemInfo", - "type": "object", - "description": "This type represents an information provided by the MEC orchestrator as a part of the \"Registration of MEC system to the federation\"", - "properties": { - "systemId": { - "description": "Identifier of the MEC system. For the uniqueness of the identifier across the federated MEC systems, UUID format [i.9] is recommended. Shall be absent in POST request, and present otherwise.", - "type": "string" - }, - "systemName": { - "description": "The name of the MEC system. This is how the MEC system identifies other MEC systems", - "type": "string" - }, - "systemProvider": { - "description": "Provider of the MEC system.", - "type": "string" + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "patch": { + "summary": "Update the system_info resource for a given MEC system.", + "description": "The PATCH method updates the information of system_info resources stored in the MEC federator through previous registration. This method is typically used in the sequence of \"Update of MEC system to the federation\" as described in clause 5.2.2.2. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.4.3.3-1 and 7.4.3.3-2.", + "operationId": "systeminfoByIdPATCH", + "tags": [ + "systemInfo" + ], + "parameters": [ + { + "$ref": "#/components/parameters/Path.systemId" + } + ], + "requestBody": { + "description": "It contains attributes to be update.", + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SystemInfoUpdate": { + "$ref": "#/components/schemas/SystemInfoUpdate" } - }, - "required": [ - "systemId", - "systemName", - "systemProvider" - ] - }, - "SystemInfoUpdate": { - "title": "SystemInfoUpdate", - "type": "object", - "description": "This type represents an information provided by MEC orchestrator as a part of the\n\"Update of MEC system(s) to the federation\".\n\nNOTE: At least one attribute shall exist.\n", - "properties": { - "systemName": { - "description": "The name of the MEC system. This is how the MEC system identifies other MEC systems.", - "type": "string" - }, - "endpoint": { - "$ref": "#/components/schemas/EndPointInfo" + } + } + } + } + }, + "responses": { + "200": { + "description": "It is used to indicate that the system_info resource is successfully updated.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SystemInfo": { + "$ref": "#/components/schemas/SystemInfo" + } } + } } + } }, - "EndPointInfo": { - "title": "EndPointInfo", - "type": "string", - "description": "Endpoint information (e.g. URI, FQDN, IP address) of MEC federator." - }, - "SystemUpdateNotificationSubscription": { - "title": "SystemUpdateNotificationSubscription", - "type": "object", - "description": "This type represents a subscription to the notifications from the MEC federator related to information update of the MEC systems in the MEC federation.", - "properties": { - "subscriptionType": { - "description": "Shall be set to \"SystemUpdateNotificationSubscription\".", - "type": "string" - }, - "callbackReference": { - "description": "URI selected by the MEC orchestrator to receive notifications on the subscribed MEC system information updates in the MEC federation. This shall be included in both the request and the response.", - "type": "string", - "format": "uri" - }, - "links": { - "$ref": "#/components/schemas/links" - }, - "systemId": { - "description": "Identifier(s) to uniquely specify the target MEC system(s) for the subscription. If absent, the subscription should include all MEC systems in the MEC federation.", - "type": "array", - "minItems": 0, - "items": { - "type": "string" - } - }, - "expiryDeadline": { - "$ref": "#/components/schemas/TimeStamp" - } - }, - "required": [ - "subscriptionType", - "callbackReference" - ] - }, - "SystemUpdateNotification": { - "title": "SystemUpdateNotification", - "type": "object", - "description": "This type represents the information that the MEC federator notifies the subscribed MEC orchestrator about the information update of the MEC systems in the MEC federation.", - "properties": { - "notificationType": { - "description": "Shall be set to \"SystemUpdateNotification\".", - "type": "string" - }, - "updatedSystemInfo": { - "description": "Updated information of the MEC system(s) in the MEC federation.", - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/components/schemas/SystemInfo" - } - }, - "links": { - "$ref": "#/components/schemas/links1" - } - }, - "required": [ - "notificationType", - "updatedSystemInfo", - "links" - ] - }, - "TimeStamp": { - "title": "TimeStamp", - "type": "object", - "description": "The expiration time of the subscription determined by the MEC Federation Enablement Service.", - "properties": { - "seconds": { - "description": "The seconds part of the time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC.", - "type": "integer", - "format": "uint32" - }, - "nanoSeconds": { - "description": "The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", - "type": "integer", - "format": "uint32" - } - }, - "required": [ - "seconds", - "nanoSeconds" - ] + "400": { + "$ref": "#/components/responses/400" }, - "links": { - "title": "links", - "description": "Object containing hyperlinks related to the resource. This shall only be included in the HTTP responses.", - "type": "object", - "properties": { - "self": { - "$ref": "#/components/schemas/LinkType" - } - }, - "required": [ - "self" - ] - }, - "links1": { - "title": "links1", - "description": "Object containing hyperlinks related to the resource.", - "type": "object", - "properties": { - "subscription": { - "$ref": "#/components/schemas/LinkType" - } - }, - "required": [ - "subscription" - ] - }, - "LinkType": { - "title": "LinkType", - "description": "Self-referring URI. The URI shall be unique within the MEC Federation Enablement API as it acts as an ID for the subscription (SubscriptionId).", - "type": "object", - "properties": { - "href": { - "description": "URI referring to a resource.", - "format": "uri", - "type": "string" - } - }, - "required": [ - "href" - ] + "401": { + "$ref": "#/components/responses/401" + }, + "403": { + "$ref": "#/components/responses/403" + }, + "404": { + "$ref": "#/components/responses/404" } + } }, - "responses": { + "delete": { + "summary": "Delete the system_info resource for a given MEC system.", + "description": "The DELETE method deletes the information of system_info resources stored in the MEF. This method is typically used in the sequence of \"Deregistration of MEC system to the federation\" as described in clause 5.2.2.1.1. The method shall comply with the URI query parameters, request and response data structures, and response codes, as specified in Tables 7.4.3.5-1 and 7.4.3.5-2.", + "operationId": "systeminfoByIdDELETE", + "tags": [ + "systemInfo" + ], + "parameters": [ + { + "$ref": "#/components/parameters/Path.systemId" + } + ], + "responses": { "204": { - "description": "No Content" + "$ref": "#/components/responses/204" }, "400": { - "description": "Bad Request: used to indicate that incorrect parameters were passed to the request.", - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } + "$ref": "#/components/responses/400" }, "401": { - "description": "Unauthorized: used when the client did not submit credentials.", - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } + "$ref": "#/components/responses/401" }, "403": { - "description": "Forbidden: operation is not allowed given the current status of the resource.", - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } + "$ref": "#/components/responses/403" }, "404": { - "description": "Not Found: used when a client provided a URI that cannot be mapped to a valid resource URI.", - "content": { - "application/problem+json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } + "$ref": "#/components/responses/404" } + } + } + } + }, + "components": { + "schemas": { + "ProblemDetails": { + "type": "object", + "properties": { + "type": { + "type": "string", + "format": "uri", + "description": "A URI reference according to IETF RFC 3986 that identifies the problem type" + }, + "title": { + "type": "string", + "description": "A short, human-readable summary of the problem type" + }, + "status": { + "type": "integer", + "format": "uint32", + "description": "The HTTP status code for this occurrence of the problem" + }, + "detail": { + "type": "string", + "description": "A human-readable explanation specific to this occurrence of the problem", + "x-etsi-mec-cardinality": "0..1", + "x-etsi-mec-origin-type": "String" + }, + "instance": { + "type": "string", + "format": "uri", + "description": "A URI reference that identifies the specific occurrence of the problem" + } + } }, - "parameters": { - "Query.systemId": { - "description": "Identifier of the MEC system.", - "name": "systemId", - "in": "query", - "required": false, - "x-exportParamName": "Query.systemId", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } + "SystemInfo": { + "title": "SystemInfo", + "type": "object", + "description": "This type represents an information provided by the MEC orchestrator as a part of the \"Registration of MEC system to the federation\"", + "properties": { + "systemId": { + "description": "Identifier of the MEC system. For the uniqueness of the identifier across the federated MEC systems, UUID format [i.9] is recommended. Shall be absent in POST request, and present otherwise.", + "type": "string" }, - "Query.systemName": { - "description": "The name of the MEC system.", - "name": "systemName", - "in": "query", - "required": false, - "x-exportParamName": "Query.systemName", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } + "systemName": { + "description": "The name of the MEC system. This is how the MEC system identifies other MEC systems", + "type": "string" }, - "Query.systemProvider": { - "description": "Provider of the MEC system.", - "name": "systemProvider", - "in": "query", - "required": false, - "x-exportParamName": "Query.systemProvider", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } + "systemProvider": { + "description": "Provider of the MEC system.", + "type": "string" + } + }, + "required": [ + "systemId", + "systemName", + "systemProvider" + ] + }, + "SystemInfoUpdate": { + "title": "SystemInfoUpdate", + "type": "object", + "description": "This type represents an information provided by MEC orchestrator as a part of the\n\"Update of MEC system(s) to the federation\".\n\nNOTE: At least one attribute shall exist.\n", + "properties": { + "systemName": { + "description": "The name of the MEC system. This is how the MEC system identifies other MEC systems.", + "type": "string" + }, + "endpoint": { + "$ref": "#/components/schemas/EndPointInfo" + } + } + }, + "EndPointInfo": { + "title": "EndPointInfo", + "type": "string", + "description": "Endpoint information (e.g. URI, FQDN, IP address) of MEC federator." + }, + "SystemUpdateNotificationSubscription": { + "title": "SystemUpdateNotificationSubscription", + "type": "object", + "description": "This type represents a subscription to the notifications from the MEC federator related to information update of the MEC systems in the MEC federation.", + "properties": { + "subscriptionType": { + "description": "Shall be set to \"SystemUpdateNotificationSubscription\".", + "type": "string" + }, + "callbackReference": { + "description": "URI selected by the MEC orchestrator to receive notifications on the subscribed MEC system information updates in the MEC federation. This shall be included in both the request and the response.", + "type": "string", + "format": "uri" + }, + "links": { + "$ref": "#/components/schemas/links" + }, + "systemId": { + "description": "Identifier(s) to uniquely specify the target MEC system(s) for the subscription. If absent, the subscription should include all MEC systems in the MEC federation.", + "type": "array", + "minItems": 0, + "items": { + "type": "string" + } + }, + "expiryDeadline": { + "$ref": "#/components/schemas/TimeStamp" + } + }, + "required": [ + "subscriptionType", + "callbackReference" + ] + }, + "SystemUpdateNotification": { + "title": "SystemUpdateNotification", + "type": "object", + "description": "This type represents the information that the MEC federator notifies the subscribed MEC orchestrator about the information update of the MEC systems in the MEC federation.", + "properties": { + "notificationType": { + "description": "Shall be set to \"SystemUpdateNotification\".", + "type": "string" + }, + "updatedSystemInfo": { + "description": "Updated information of the MEC system(s) in the MEC federation.", + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/components/schemas/SystemInfo" + } + }, + "links": { + "$ref": "#/components/schemas/links1" + } + }, + "required": [ + "notificationType", + "updatedSystemInfo", + "links" + ] + }, + "TimeStamp": { + "title": "TimeStamp", + "type": "object", + "description": "The expiration time of the subscription determined by the MEC Federation Enablement Service.", + "properties": { + "seconds": { + "description": "The seconds part of the time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC.", + "type": "integer", + "format": "uint32" + }, + "nanoSeconds": { + "description": "The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.", + "type": "integer", + "format": "uint32" + } + }, + "required": [ + "seconds", + "nanoSeconds" + ] + }, + "links": { + "title": "links", + "description": "Object containing hyperlinks related to the resource. This shall only be included in the HTTP responses.", + "type": "object", + "properties": { + "self": { + "$ref": "#/components/schemas/LinkType" + } + }, + "required": [ + "self" + ] + }, + "links1": { + "title": "links1", + "description": "Object containing hyperlinks related to the resource.", + "type": "object", + "properties": { + "subscription": { + "$ref": "#/components/schemas/LinkType" + } + }, + "required": [ + "subscription" + ] + }, + "LinkType": { + "title": "LinkType", + "description": "Self-referring URI. The URI shall be unique within the MEC Federation Enablement API as it acts as an ID for the subscription (SubscriptionId).", + "type": "object", + "properties": { + "href": { + "description": "URI referring to a resource.", + "format": "uri", + "type": "string" + } + }, + "required": [ + "href" + ] + } + }, + "responses": { + "204": { + "description": "No Content" + }, + "400": { + "description": "Bad Request: used to indicate that incorrect parameters were passed to the request.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "401": { + "description": "Unauthorized: used when the client did not submit credentials.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "403": { + "description": "Forbidden: operation is not allowed given the current status of the resource.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + }, + "404": { + "description": "Not Found: used when a client provided a URI that cannot be mapped to a valid resource URI.", + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/ProblemDetails" + } + } + } + } + }, + "parameters": { + "Query.systemId": { + "description": "Identifier of the MEC system.", + "name": "systemId", + "in": "query", + "required": false, + "x-exportParamName": "Query.systemId", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Path.systemId": { + "description": "Identifier of the MEC system.", + "name": "systemId", + "in": "path", + "required": true, + "x-exportParamName": "Path.systemId", + "schema": { + "type": "string" + } + }, + "Query.systemName": { + "description": "The name of the MEC system.", + "name": "systemName", + "in": "query", + "required": false, + "x-exportParamName": "Query.systemName", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "Query.systemProvider": { + "description": "Provider of the MEC system.", + "name": "systemProvider", + "in": "query", + "required": false, + "x-exportParamName": "Query.systemProvider", + "schema": { + "type": "array", + "items": { + "type": "string" } + } } + } } -} \ No newline at end of file + } \ No newline at end of file diff --git a/MEC040_fedEnablement.yaml b/MEC040_fedEnablement.yaml index a35841d..0170c53 100644 --- a/MEC040_fedEnablement.yaml +++ b/MEC040_fedEnablement.yaml @@ -88,7 +88,7 @@ paths: tags: - systemInfo parameters: - - $ref: '#/components/parameters/Query.systemId' + - $ref: '#/components/parameters/Path.systemId' responses: '200': description: It is used to indicate that the query for retrieving system_info resource is successful. Response body containing one system_info resource shall be returned. @@ -114,7 +114,7 @@ paths: tags: - systemInfo parameters: - - $ref: '#/components/parameters/Query.systemId' + - $ref: '#/components/parameters/Path.systemId' requestBody: description: It contains attributes to be update. required: true @@ -150,7 +150,7 @@ paths: tags: - systemInfo parameters: - - $ref: '#/components/parameters/Query.systemId' + - $ref: '#/components/parameters/Path.systemId' responses: '204': $ref: '#/components/responses/204' @@ -363,6 +363,14 @@ components: type: array items: type: string + Path.systemId: + description: Identifier of the MEC system. + name: systemId + in: path + required: true + x-exportParamName: Path.systemId + schema: + type: string Query.systemName: description: The name of the MEC system. name: systemName -- GitLab From 52bb3a2b1b666f4df09bf4c45fb3f422fd6c7e21 Mon Sep 17 00:00:00 2001 From: Mubeena Date: Tue, 5 Sep 2023 12:37:36 +0500 Subject: [PATCH 4/8] add proto3 descriptors --- proto3/.openapi-generator-ignore | 23 ++++++ proto3/.openapi-generator/FILES | 13 ++++ proto3/.openapi-generator/VERSION | 1 + proto3/README.md | 32 +++++++++ proto3/models/endpoint_info.proto | 20 ++++++ proto3/models/link_type.proto | 21 ++++++ proto3/models/links.proto | 21 ++++++ proto3/models/links1.proto | 21 ++++++ proto3/models/problem_details.proto | 33 +++++++++ proto3/models/system_info.proto | 27 +++++++ proto3/models/system_info_update.proto | 25 +++++++ .../models/system_update_notification.proto | 28 ++++++++ ...tem_update_notification_subscription.proto | 33 +++++++++ proto3/models/time_stamp.proto | 24 +++++++ proto3/services/system_info_service.proto | 71 +++++++++++++++++++ 15 files changed, 393 insertions(+) create mode 100644 proto3/.openapi-generator-ignore create mode 100644 proto3/.openapi-generator/FILES create mode 100644 proto3/.openapi-generator/VERSION create mode 100644 proto3/README.md create mode 100644 proto3/models/endpoint_info.proto create mode 100644 proto3/models/link_type.proto create mode 100644 proto3/models/links.proto create mode 100644 proto3/models/links1.proto create mode 100644 proto3/models/problem_details.proto create mode 100644 proto3/models/system_info.proto create mode 100644 proto3/models/system_info_update.proto create mode 100644 proto3/models/system_update_notification.proto create mode 100644 proto3/models/system_update_notification_subscription.proto create mode 100644 proto3/models/time_stamp.proto create mode 100644 proto3/services/system_info_service.proto diff --git a/proto3/.openapi-generator-ignore b/proto3/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/proto3/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/proto3/.openapi-generator/FILES b/proto3/.openapi-generator/FILES new file mode 100644 index 0000000..d99d1fc --- /dev/null +++ b/proto3/.openapi-generator/FILES @@ -0,0 +1,13 @@ +.openapi-generator-ignore +README.md +models/endpoint_info.proto +models/link_type.proto +models/links.proto +models/links1.proto +models/problem_details.proto +models/system_info.proto +models/system_info_update.proto +models/system_update_notification.proto +models/system_update_notification_subscription.proto +models/time_stamp.proto +services/system_info_service.proto diff --git a/proto3/.openapi-generator/VERSION b/proto3/.openapi-generator/VERSION new file mode 100644 index 0000000..1e20ec3 --- /dev/null +++ b/proto3/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.4.0 \ No newline at end of file diff --git a/proto3/README.md b/proto3/README.md new file mode 100644 index 0000000..92f6395 --- /dev/null +++ b/proto3/README.md @@ -0,0 +1,32 @@ +# gPRC for mec040 + +The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI + +## Overview +These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. + +- API version: 3.1.1 +- Package version: +- Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen +For more information, please visit [https://forge.etsi.org/rep/mec/gs040-fed-enablement-api](https://forge.etsi.org/rep/mec/gs040-fed-enablement-api) + +## Usage + +Below are some usage examples for Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Go +``` +# assuming `protoc-gen-go` has been installed with `go get -u github.com/golang/protobuf/protoc-gen-go` +mkdir /var/tmp/go/ +protoc --go_out=/var/tmp/go/ services/* +protoc --go_out=/var/tmp/go/ models/* +``` + +### Ruby +``` +# assuming `grpc_tools_ruby_protoc` has been installed via `gem install grpc-tools` +RUBY_OUTPUT_DIR="/var/tmp/ruby/mec040" +mkdir $RUBY_OUTPUT_DIR +grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib services/* +grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib models/* +``` diff --git a/proto3/models/endpoint_info.proto b/proto3/models/endpoint_info.proto new file mode 100644 index 0000000..81b0b2e --- /dev/null +++ b/proto3/models/endpoint_info.proto @@ -0,0 +1,20 @@ +/* + ETSI GS MEC 040 - MEC Federation enablement APIs + + The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI + + The version of the OpenAPI document: 3.1.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec040; + +message EndPointInfo { + + // URI referring to a resource. + string EndPointInfo = 1; + +} diff --git a/proto3/models/link_type.proto b/proto3/models/link_type.proto new file mode 100644 index 0000000..f8fb6a7 --- /dev/null +++ b/proto3/models/link_type.proto @@ -0,0 +1,21 @@ +/* + ETSI GS MEC 040 - MEC Federation enablement APIs + + The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI + + The version of the OpenAPI document: 3.1.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec040; + + +message LinkType { + + // URI referring to a resource. + string href = 1; + +} diff --git a/proto3/models/links.proto b/proto3/models/links.proto new file mode 100644 index 0000000..b54e78d --- /dev/null +++ b/proto3/models/links.proto @@ -0,0 +1,21 @@ +/* + ETSI GS MEC 040 - MEC Federation enablement APIs + + The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI + + The version of the OpenAPI document: 3.1.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec040; + +import public "models/link_type.proto"; + +message Links { + + LinkType self = 1; + +} diff --git a/proto3/models/links1.proto b/proto3/models/links1.proto new file mode 100644 index 0000000..6b8dc70 --- /dev/null +++ b/proto3/models/links1.proto @@ -0,0 +1,21 @@ +/* + ETSI GS MEC 040 - MEC Federation enablement APIs + + The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI + + The version of the OpenAPI document: 3.1.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec040; + +import public "models/link_type.proto"; + +message Links1 { + + LinkType subscription = 1; + +} diff --git a/proto3/models/problem_details.proto b/proto3/models/problem_details.proto new file mode 100644 index 0000000..bd59658 --- /dev/null +++ b/proto3/models/problem_details.proto @@ -0,0 +1,33 @@ +/* + ETSI GS MEC 040 - MEC Federation enablement APIs + + The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI + + The version of the OpenAPI document: 3.1.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec040; + + +message ProblemDetails { + + // A URI reference according to IETF RFC 3986 that identifies the problem type + string type = 1; + + // A short, human-readable summary of the problem type + string title = 2; + + // The HTTP status code for this occurrence of the problem + int32 status = 3; + + // A human-readable explanation specific to this occurrence of the problem + string detail = 4; + + // A URI reference that identifies the specific occurrence of the problem + string instance = 5; + +} diff --git a/proto3/models/system_info.proto b/proto3/models/system_info.proto new file mode 100644 index 0000000..db9d1f3 --- /dev/null +++ b/proto3/models/system_info.proto @@ -0,0 +1,27 @@ +/* + ETSI GS MEC 040 - MEC Federation enablement APIs + + The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI + + The version of the OpenAPI document: 3.1.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec040; + + +message SystemInfo { + + // Identifier of the MEC system. For the uniqueness of the identifier across the federated MEC systems, UUID format [i.9] is recommended. Shall be absent in POST request, and present otherwise. + string systemId = 1; + + // The name of the MEC system. This is how the MEC system identifies other MEC systems + string systemName = 2; + + // Provider of the MEC system. + string systemProvider = 3; + +} diff --git a/proto3/models/system_info_update.proto b/proto3/models/system_info_update.proto new file mode 100644 index 0000000..ed73412 --- /dev/null +++ b/proto3/models/system_info_update.proto @@ -0,0 +1,25 @@ +/* + ETSI GS MEC 040 - MEC Federation enablement APIs + + The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI + + The version of the OpenAPI document: 3.1.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec040; + +import public "models/endpoint_info.proto"; + +message SystemInfoUpdate { + + // The name of the MEC system. This is how the MEC system identifies other MEC systems. + string systemName = 1; + + // Endpoint information (e.g. URI, FQDN, IP address) of MEC federator. + EndPointInfo endpoint = 2; + +} diff --git a/proto3/models/system_update_notification.proto b/proto3/models/system_update_notification.proto new file mode 100644 index 0000000..b330cea --- /dev/null +++ b/proto3/models/system_update_notification.proto @@ -0,0 +1,28 @@ +/* + ETSI GS MEC 040 - MEC Federation enablement APIs + + The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI + + The version of the OpenAPI document: 3.1.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec040; + +import public "models/links1.proto"; +import public "models/system_info.proto"; + +message SystemUpdateNotification { + + // Shall be set to \"SystemUpdateNotification\". + string notificationType = 1; + + // Updated information of the MEC system(s) in the MEC federation. + repeated SystemInfo updatedSystemInfo = 2; + + Links1 links = 3; + +} diff --git a/proto3/models/system_update_notification_subscription.proto b/proto3/models/system_update_notification_subscription.proto new file mode 100644 index 0000000..a1c195a --- /dev/null +++ b/proto3/models/system_update_notification_subscription.proto @@ -0,0 +1,33 @@ +/* + ETSI GS MEC 040 - MEC Federation enablement APIs + + The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI + + The version of the OpenAPI document: 3.1.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec040; + +import public "models/links.proto"; +import public "models/time_stamp.proto"; + +message SystemUpdateNotificationSubscription { + + // Shall be set to \"SystemUpdateNotificationSubscription\". + string subscriptionType = 1; + + // URI selected by the MEC orchestrator to receive notifications on the subscribed MEC system information updates in the MEC federation. This shall be included in both the request and the response. + string callbackReference = 2; + + Links links = 3; + + // Identifier(s) to uniquely specify the target MEC system(s) for the subscription. If absent, the subscription should include all MEC systems in the MEC federation. + repeated string systemId = 4; + + TimeStamp expiryDeadline = 5; + +} diff --git a/proto3/models/time_stamp.proto b/proto3/models/time_stamp.proto new file mode 100644 index 0000000..c4c59f3 --- /dev/null +++ b/proto3/models/time_stamp.proto @@ -0,0 +1,24 @@ +/* + ETSI GS MEC 040 - MEC Federation enablement APIs + + The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI + + The version of the OpenAPI document: 3.1.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec040; + + +message TimeStamp { + + // The seconds part of the time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC. + int32 seconds = 1; + + // The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC. + int32 nanoSeconds = 2; + +} diff --git a/proto3/services/system_info_service.proto b/proto3/services/system_info_service.proto new file mode 100644 index 0000000..fb8d6d9 --- /dev/null +++ b/proto3/services/system_info_service.proto @@ -0,0 +1,71 @@ +/* + ETSI GS MEC 040 - MEC Federation enablement APIs + + The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI + + The version of the OpenAPI document: 3.1.1 + + Generated by OpenAPI Generator: https://openapi-generator.tech +*/ + +syntax = "proto3"; + +package mec040.services.systeminfoservice; + +import "google/protobuf/empty.proto"; +import public "models/system_info.proto"; +import public "models/system_info_update.proto"; +import public "models/problem_details.proto"; + + +service SystemInfoService { + rpc SysteminfoByIdDELETE (SysteminfoByIdDELETERequest) returns (google.protobuf.Empty); + + rpc SysteminfoByIdGET (SysteminfoByIdGETRequest) returns (SystemInfo); + + rpc SysteminfoByIdPATCH (SysteminfoByIdPATCHRequest) returns (SystemInfo); + + rpc SysteminfoGET (SysteminfoGETRequest) returns (SysteminfoGETResponse); + + rpc SysteminfoPOST (SysteminfoPOSTRequest) returns (SystemInfo); + +} + +message SysteminfoByIdDELETERequest { + // Identifier of the MEC system. + repeated string systemid = 1; + +} + +message SysteminfoByIdGETRequest { + // Identifier of the MEC system. + repeated string systemid = 1; + +} + +message SysteminfoByIdPATCHRequest { + SystemInfoUpdate systemInfoUpdate = 1; + // Identifier of the MEC system. + repeated string systemid = 2; + +} + +message SysteminfoGETRequest { + // Identifier of the MEC system. + repeated string systemid = 1; + // The name of the MEC system. + repeated string systemname = 2; + // Provider of the MEC system. + repeated string systemprovider = 3; + +} + +message SysteminfoGETResponse { + repeated SystemInfo data = 1; +} + +message SysteminfoPOSTRequest { + SystemInfo systemInfo = 1; + +} + -- GitLab From 6a0a1a84df651843f37eea3130dbec7480020642 Mon Sep 17 00:00:00 2001 From: Mubeena Date: Tue, 5 Sep 2023 12:44:22 +0500 Subject: [PATCH 5/8] Update README --- README.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index eb8cb15..5135dc0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,20 @@ -# MEC Federation enablement APIs +# Federation enablement APIs + +This repository contains OpenAPIs descriptions for the interfaces specified in ETSI GS MEC 021. + +## Online resources + +* [Specification document](https://www.etsi.org/deliver/etsi_gs/MEC/001_099/040/03.01.01_60/gs_mec040v030101p.pdf) + +## Navigate with Swagger UI +* [Federation enablement APIs](https://forge.etsi.org/swagger/ui/?url=https://forge.etsi.org/rep/mec/gs040-fed-enablement-api/raw/stf644/MEC040_fedEnablement.yaml). + +## Navigate with Redocly +* [Federation enablement APIs](https://redocly.github.io/redoc/?url=https://forge.etsi.org/rep/mec/gs040-fed-enablement-api/raw/stf644/MEC040_fedEnablement.yaml). + +## License + +Unless specified otherwise, the content of this repository and the files contained are released under the BSD-3-Clause license. +See the attached LICENSE file or visit https://forge.etsi.org/legal-matters. -MEC Federation enablement APIs - ETSI GS MEC 040 -DRAFT specification is available at https://docbox.etsi.org/ISG/MEC/Open/MEC040%20FederationAPI%20drafts -- GitLab From 5f978757538b8ec0b2e853e6daa5b33647f5683f Mon Sep 17 00:00:00 2001 From: Mubeena Date: Tue, 5 Sep 2023 14:57:28 +0500 Subject: [PATCH 6/8] add proto3-gen.md for proto3 generation and usage --- proto3-gen.md | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 proto3-gen.md diff --git a/proto3-gen.md b/proto3-gen.md new file mode 100644 index 0000000..c8a15eb --- /dev/null +++ b/proto3-gen.md @@ -0,0 +1,138 @@ +# Protobuf Schema Generation + +[OpenAPI Generator](https://openapi-generator.tech) is used to generate protobuf schema (`.proto3`) files from OpenAPI specifications of MEC040 Federation enablement APIs. + +>**NOTE:** At the time of writing, the tool does not support OAS 3.1 version and we have to first convert the [Federation enablement APIs](./MEC040_fedEnablement.yaml) to OAS 3.0 for generating protobuf schema. + +1. Convert OAS for [Federation enablement APIs](./MEC040_fedEnablement.yaml) from 3.1 to 3.0​ + + - Change the value of `openapi` field from 3.1.0 to 3.0.0​ + + - Use this [VS code extension](https://marketplace.visualstudio.com/items?itemName=42Crunch.vscode-openapi) to see the errors in the downgraded YAML (v3.0)​ + + - Manually fix the errors​ + - some 3.1 fields that are not supported in 3.0​ (comment them out) + +2. Generate proto files + - Install the `openapi-generator-cli-5.4.0.jar` using the installation procedure mentioned [here](https://openapi-generator.tech/docs/installation#jar). + - Generate the proto files using the following commands: + ```sh + $ java -jar openapi-generator-cli.jar generate -i MEC040_fedEnablement.yaml -g protobuf-schema -o proto3/ --package-name mec040 + ``` + +3. Carefully inspect the generated `.proto` files for any inconsistencies. Some of the things to look out for: + - Proto3 generated files for enumerations, structures containing allOf, oneOf, anyOf etc. may need to be touched manually + - Check that all the nested models are being _imported_ correctly in their parent models + - Remove redundant proto files + + +4. Validate protobuf schema by generating code from proto3 descriptions in different languages. See [this section](#code-generation-from-proto3) for more details. + +# Code Generation from proto3 + +Below are some code generation examples for Python, Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. + +### Python + +1. Install the grpcio-tools package + ```sh + $ pip install grpcio-tools + ``` + +2. Create a directory for generated Python stubs + ```sh + $ mkdir python-stubs + ``` + +3. Run the following commands from the root of the directory containing this README that you are reading. + + - Models: + + ```sh + $ python -m grpc_tools.protoc -I./proto3 --python_out=./python-stubs ./proto3/models/* + ``` + + The above commands will generate .py files for all the data models in the ./models directory + + - Services: + + ```sh + $ python -m grpc_tools.protoc -I./proto3 --python_out=./python-stubs --grpc_python_out=./python-stubs ./proto3/services/system_info_service.proto + ``` + + The above commands will generate two files for the FedEnablement service: + - _system_info_service_pb2.py_: containing the python data models used in the FedEnablement service file + - _system_info_service_pb2_grpc.py_: containing all the classes and functions needed for the supported HTTP methods in the FedEnablement API + +### Go + +1. Install protocol buffer compiler + ```sh + $ apt install -y protobuf-compiler + ``` +2. Install Go plugins for `protoc` + ```sh + $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 + ``` + ```sh + $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 + ``` +3. Update `PATH` so `protoc` can find the plugins + ```sh + $ export PATH="$PATH:$(go env GOPATH)/bin" + ``` +4. Define a go package by appending `option go_package = "./mec040";` in all .proto files like this: + + ```Go + ... + + syntax = "proto3"; + + package mec040; + + option go_package = "./mec040"; + + import public "models/.proto"; + + ... + ``` +5. Generate Go code for models and services + ```sh + $ mkdir go-stubs + + $ protoc --go_out=./go-stubs ./proto3/models/* -I./proto3 + + $ protoc --go_out=./go-stubs ./proto3/services/* --go-grpc_out=go-stubs -I./proto3 + + ``` + + + > The generated `.pb.go` files will contain all the protocol buffer code to populate, serialize, and retrieve request and response message types defined in the `models` folder. + + > The `system_info_service_grpc.pb.go` will contain the stubs for the methods defined in the `system_info_service.proto` file. + +### Ruby + +1. Install gRPC Ruby Plugin and required tools + ```sh + $ gem install grpc + $ sudo apt install ruby-grpc-tools + ``` + +2. Generate code + ```sh + $ mkdir ruby-stubs + ``` + + Run the following commands to create Ruby modules for all the data models defined in the proto files. + + ```sh + $ grpc_tools_ruby_protoc -I./proto3 --ruby_out=ruby-stubs ./proto3/models/* + + ``` + Run the following command to generate `system_info_service_pb.rb`and `system_info_service_services_pb.rb` files, containing stub and service classes for the endpoints and methods defined in MEC040 Federation enablement APIs. + + ```sh + $ grpc_tools_ruby_protoc -I./proto3 --ruby_out=ruby-stubs --grpc_out=ruby-stubs ./proto3/services/* + + ``` \ No newline at end of file -- GitLab From b2d6dc1d0f0d67d50ce36acddc9947769b9e2f6e Mon Sep 17 00:00:00 2001 From: Mubeena Date: Tue, 5 Sep 2023 15:22:31 +0500 Subject: [PATCH 7/8] add README in proto3 folder --- proto3/README.md | 110 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 94 insertions(+), 16 deletions(-) diff --git a/proto3/README.md b/proto3/README.md index 92f6395..5b3519c 100644 --- a/proto3/README.md +++ b/proto3/README.md @@ -1,6 +1,6 @@ # gPRC for mec040 -The ETSI MEC ISG MEC040 Federation enablement API described using OpenAPI +ETSI GS MEC 040 Federation enablement APIs described using OpenAPI. ## Overview These files were generated by the [OpenAPI Generator](https://openapi-generator.tech) project. @@ -8,25 +8,103 @@ These files were generated by the [OpenAPI Generator](https://openapi-generator. - API version: 3.1.1 - Package version: - Build package: org.openapitools.codegen.languages.ProtobufSchemaCodegen -For more information, please visit [https://forge.etsi.org/rep/mec/gs040-fed-enablement-api](https://forge.etsi.org/rep/mec/gs040-fed-enablement-api) +For more information, please visit [https://forge.etsi.org/rep/mec/gs040-fed-enablement-api](https://forge.etsi.org/rep/mec/gs040-fed-enablement-api/) ## Usage -Below are some usage examples for Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. +Below are some code generation examples for Python, Go and Ruby. For other languages, please refer to https://grpc.io/docs/quickstart/. +### Python + +1. Install the grpcio-tools package + ```sh + $ pip install grpcio-tools + ``` + +2. Create a directory for generated Python stubs + ```sh + $ mkdir python-stubs + ``` + +3. Run the following commands from the root of the directory containing this README that you are reading. + + - Models: + + ```sh + $ python -m grpc_tools.protoc -I./proto3 --python_out=./python-stubs ./proto3/models/* + ``` + + The above command will generate .py files for all the data models in the ./models directory + + - Services: + + ```sh + $ python -m grpc_tools.protoc -I./proto3 --python_out=./python-stubs --grpc_python_out=./python-stubs ./proto3/services/system_info_service.proto + ``` + + The above command will generate two files for the Federation Enablement service: + - _system_info_service_pb2.py: containing the python data models used in the service file + - _system_info_service_pb2_grpc.py: containing all the classes and functions needed for the supported HTTP methods in the service file ### Go -``` -# assuming `protoc-gen-go` has been installed with `go get -u github.com/golang/protobuf/protoc-gen-go` -mkdir /var/tmp/go/ -protoc --go_out=/var/tmp/go/ services/* -protoc --go_out=/var/tmp/go/ models/* -``` + +1. Install protocol buffer compiler + ```sh + $ apt install -y protobuf-compiler + ``` +2. Install Go plugins for `protoc` + ```sh + $ go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1 + ``` + ```sh + $ go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2.0 + ``` +3. Update `PATH` so `protoc` can find the plugins + ```sh + $ export PATH="$PATH:$(go env GOPATH)/bin" + ``` +4. Define a go package by appending `option go_package = "./mec040";` in all .proto files like this: + + ```Go + ... + + syntax = "proto3"; + + package mec040; + + option go_package = "./mec040"; + + import public "models/.proto"; + + ... + ``` +5. Generate Go code for models and services + ```sh + $ mkdir go-stubs + $ protoc --go_out=./go-stubs ./proto3/models/* -I./proto3 + $ protoc --go_out=./go-stubs ./proto3/services/* --go-grpc_out=go-stubs -I./proto3 + ``` + > The generated `.pb.go` files will contain all the protocol buffer code to populate, serialize, and retrieve request and response message types defined in the `models` folder. + > And the `system_info_service_grpc.pb.go` will contain the stubs for the methods defined in the `system_info_service.proto` file. ### Ruby -``` -# assuming `grpc_tools_ruby_protoc` has been installed via `gem install grpc-tools` -RUBY_OUTPUT_DIR="/var/tmp/ruby/mec040" -mkdir $RUBY_OUTPUT_DIR -grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib services/* -grpc_tools_ruby_protoc --ruby_out=$RUBY_OUTPUT_DIR --grpc_out=$RUBY_OUTPUT_DIR/lib models/* -``` + +1. Install gRPC Ruby Plugin and required tools + ```sh + $ gem install grpc + $ sudo apt install ruby-grpc-tools + ``` + +2. Generate code + ```sh + $ mkdir ruby-stubs + ``` + + Run the following command to create Ruby modules for all the data models defined in the proto files. + + ```sh + $ grpc_tools_ruby_protoc -I./proto3 --ruby_out=ruby-stubs ./proto3/models/* + ``` + Run the following command to generate `system_info_service_pb2.rb` and `system_info_service_pb2_grpc.rb` files, containing stub and service classes for the endpoints and methods defined in MEC040 service. + + ```sh + $ grpc_tools_ruby_protoc -I./proto3 --ruby_out=ruby-stubs --grpc_out=ruby-stubs ./proto3/services/* -- GitLab From cc0d59a066f21d92d40dd29f7939d93e2368d295 Mon Sep 17 00:00:00 2001 From: Mubeena Date: Tue, 5 Sep 2023 15:25:13 +0500 Subject: [PATCH 8/8] fix openapi version in OAS --- MEC040_fedEnablement.json | 2 +- MEC040_fedEnablement.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MEC040_fedEnablement.json b/MEC040_fedEnablement.json index 4027258..ed3cdbe 100644 --- a/MEC040_fedEnablement.json +++ b/MEC040_fedEnablement.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.0", + "openapi": "3.1.0", "info": { "contact": { "url": "https://forge.etsi.org/rep/mec/gs040-fed-enablement-api" diff --git a/MEC040_fedEnablement.yaml b/MEC040_fedEnablement.yaml index 0170c53..63170c9 100644 --- a/MEC040_fedEnablement.yaml +++ b/MEC040_fedEnablement.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.0 +openapi: 3.1.0 info: contact: url: https://forge.etsi.org/rep/mec/gs040-fed-enablement-api -- GitLab