diff --git a/go-apps/meep-app-enablement/api/capif-mgmt/swagger.yaml b/go-apps/meep-app-enablement/api/capif-mgmt/swagger.yaml index a08ba68fc0194d9ee4bea974f145771292314d2f..e803dcdbe5604aa6da75f3045a98139b1544ebf1 100644 --- a/go-apps/meep-app-enablement/api/capif-mgmt/swagger.yaml +++ b/go-apps/meep-app-enablement/api/capif-mgmt/swagger.yaml @@ -1131,6 +1131,11 @@ components: type: string description: | If present, shall be set to the value of the "serInstanceId" attribute as defined in clause 8.1.2.2. + aefProfiles: + type: array + items: + $ref: '#/components/schemas/AefProfile' + description: "AEF profile information, which includes the exposed API details (e.g., protocol). For CAPIF-4/4e interface, API publishing function shall provide this attribute to the CCF in service API publishing. For CAPIF-1/1e interface, the CCF shall provide this attribute to the API Invoker during service API discovery." vendorSpecific-urn:etsi:mec:capifext:service-info: $ref: '#/components/schemas/MecServiceInfoCapifExt' example: @@ -1162,6 +1167,7 @@ components: type: boolean category: $ref: '#/components/schemas/CategoryRef' + MecServiceInfoCapifExt: type: object properties: @@ -1188,6 +1194,188 @@ components: id: id version: version isLocal: true + AefProfile: + type: object + properties: + aefId: + type: string + description: "AEF identifier. Shall be set to the value of the 'id' attribute as defined in clause 8.1.2.3." + versions: + type: array + items: + type: string + description: "API version. This array shall contain a single entry." + minItems: 1 + maxItems: 1 + interfaceDescriptions: + description: This type represents information about a transport endpoint + oneOf: + - $ref: '#/components/schemas/EndPointInfo.Uris' + - $ref: '#/components/schemas/EndPointInfo.Fqdn' + - $ref: '#/components/schemas/EndPointInfo.Addresses' + - $ref: '#/components/schemas/EndPointInfo.Alternative' + x-etsi-notes: "NOTE:\tExactly one of \"uris\", \"fqdn\", \"addresses\" or\ + \ \"alternative\" shall be present." + vendorSpecific-urn:etsi:mec:capifext:transport-info : + $ref: '#/components/schemas/MecTransportInfoCapifExt' + description: "Additional attribute of data type MecTransportInfoCapifExt for MEC-specific CAPIF extensions related to alternative transports." + required: + - aefId + - versions + MecTransportInfoCapifExt: + type: object + properties: + name: + type: string + description: "Name of the transport info." + description: + type: string + description: "Description of the transport info." + type: + $ref: '#/components/schemas/TransportType' + protocol: + type: string + description: The name of the protocol used. Shall be set to HTTP for a REST + API. + example: "[\"HTTP\"]" + version: + type: string + description: The version of the protocol used + example: "[\"2.0\"]" + security: + $ref: '#/components/schemas/SecurityInfo' + description: "Security information of the transport." + implSpecificInfo: + type: string + description: Additional implementation specific details of the transport + description: This type represents the general information of a MEC service. + SecurityInfo.OAuth2Info.GrantType: + title: SecurityInfo.OAuth2Info.GrantType + type: string + description: OAuth 2.0 grant type + example: "[\"OAUTH2_CLIENT_CREDENTIALS\"]" + enum: + - OAUTH2_AUTHORIZATION_CODE + - OAUTH2_IMPLICIT_GRANT + - OAUTH2_RESOURCE_OWNER + - OAUTH2_CLIENT_CREDENTIALS + SecurityInfo.OAuth2Info: + title: SecurityInfo.OAuth2Info + required: + - grantTypes + - tokenEndpoint + type: object + properties: + grantTypes: + maxItems: 4 + minItems: 1 + type: array + description: List of supported OAuth 2.0 grant types. + items: + $ref: '#/components/schemas/SecurityInfo.OAuth2Info.GrantType' + tokenEndpoint: + type: string + description: The token endpoint + example: "[\"/mecSerMgmtApi/security/TokenEndPoint\"]" + description: Parameters related to use of OAuth 2.0 + example: + tokenEndpoint: "[\"/mecSerMgmtApi/security/TokenEndPoint\"]" + grantTypes: + - "[\"OAUTH2_CLIENT_CREDENTIALS\"]" + - "[\"OAUTH2_CLIENT_CREDENTIALS\"]" + - "[\"OAUTH2_CLIENT_CREDENTIALS\"]" + - "[\"OAUTH2_CLIENT_CREDENTIALS\"]" + SecurityInfo: + title: SecurityInfo + type: object + properties: + oAuth2Info: + $ref: '#/components/schemas/SecurityInfo.OAuth2Info' + description: This type represents security information related to a transport + example: + oAuth2Info: + tokenEndpoint: "[\"/mecSerMgmtApi/security/TokenEndPoint\"]" + grantTypes: + - "[\"OAUTH2_CLIENT_CREDENTIALS\"]" + - "[\"OAUTH2_CLIENT_CREDENTIALS\"]" + - "[\"OAUTH2_CLIENT_CREDENTIALS\"]" + - "[\"OAUTH2_CLIENT_CREDENTIALS\"]" + TransportType: + title: TransportType + type: string + description: The enumeration TransportType represents types of transports + example: "[\"REST_HTTP\"]" + enum: + - REST_HTTP + - MB_TOPIC_BASED + - MB_ROUTING + - MB_PUBSUB + - RPC + - RPC_STREAMING + - WEBSOCKET + EndPointInfo.Alternative: + title: EndPointInfo.Alternative + required: + - alternative + type: object + properties: + alternative: + type: object + description: "Entry point information of the service in a format defined\ + \ by an implementation, or in an external specification. See note." + description: This type represents information about a transport endpoint. + EndPointInfo.Address: + title: EndPointInfo.Address + required: + - host + - port + type: object + properties: + host: + type: string + description: Host portion of the address + example: "[\"192.0.2.0\"]" + port: + type: integer + description: Port portion of the address + description: A IP address and port pair + EndPointInfo.Addresses: + title: EndPointInfo.Addresses + required: + - addresses + type: object + properties: + addresses: + type: array + description: Entry point information of the service as one or more pairs + of IP address and port. See note. + items: + $ref: '#/components/schemas/EndPointInfo.Address' + EndPointInfo.Fqdn: + title: EndPointInfo.Fqdn + required: + - fqdn + type: object + properties: + fqdn: + type: array + description: Fully Qualified Domain Name of the service. See note. + items: + type: string + description: 'This type represents information about a transport endpoint. ' + EndPointInfo.Uris: + title: EndPointInfo.Uris + required: + - uris + type: object + properties: + uris: + type: array + description: "Entry point information of the service as string, formatted\ + \ according to URI syntax" + items: + type: string + description: This type represents information about a transport endpoint. responses: "400": description: Bad Request. It is used to indicate that incorrect parameters were diff --git a/go-apps/meep-app-enablement/server/capif-mgmt/model_aef_profile.go b/go-apps/meep-app-enablement/server/capif-mgmt/model_aef_profile.go new file mode 100644 index 0000000000000000000000000000000000000000..a75f72a07b85f84274c453ae4bd8356ccbfaeec0 --- /dev/null +++ b/go-apps/meep-app-enablement/server/capif-mgmt/model_aef_profile.go @@ -0,0 +1,21 @@ +/* + * MEC service management realized by CAPIF APIs + * + * The ETSI MEC ISG MEC011 MEC Service Management realized by CAPIF APIs described using OpenAPI + * + * API version: 3.2.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +type AefProfile struct { + // AEF identifier. Shall be set to the value of the 'id' attribute as defined in clause 8.1.2.3. + AefId string `json:"aefId"` + + Versions []string `json:"versions"` + // This type represents information about a transport endpoint + InterfaceDescriptions *OneOfTransportInfoEndpoint `json:"interfaceDescriptions,omitempty"` + + VendorSpecificUrnetsimeccapifexttransportInfo *MecTransportInfoCapifExt `json:"vendorSpecific-urn:etsi:mec:capifext:transport-info,omitempty"` +} diff --git a/go-apps/meep-app-enablement/server/capif-mgmt/model_mec_transport_info_capif_ext.go b/go-apps/meep-app-enablement/server/capif-mgmt/model_mec_transport_info_capif_ext.go new file mode 100644 index 0000000000000000000000000000000000000000..b0adc7bfc842e422ca84bd1309436fd85059e7c1 --- /dev/null +++ b/go-apps/meep-app-enablement/server/capif-mgmt/model_mec_transport_info_capif_ext.go @@ -0,0 +1,29 @@ +/* + * MEC service management realized by CAPIF APIs + * + * The ETSI MEC ISG MEC011 MEC Service Management realized by CAPIF APIs described using OpenAPI + * + * API version: 3.2.1 + * Contact: cti_support@etsi.org + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package server + +// This type represents the general information of a MEC service. + type MecTransportInfoCapifExt struct { + // Name of the transport info. + Name string `json:"name,omitempty"` + // Description of the transport info. + Description string `json:"description,omitempty"` + + Type_ *TransportType `json:"type,omitempty"` + // The name of the protocol used. Shall be set to HTTP for a REST API. + Protocol string `json:"protocol,omitempty"` + // The version of the protocol used + Version string `json:"version,omitempty"` + + Security *SecurityInfo `json:"security,omitempty"` + // Additional implementation specific details of the transport + ImplSpecificInfo string `json:"implSpecificInfo,omitempty"` + } + \ No newline at end of file diff --git a/go-apps/meep-app-enablement/server/capif-mgmt/model_service_api_description.go b/go-apps/meep-app-enablement/server/capif-mgmt/model_service_api_description.go index 6ad3723efa0ee8c4197c362ffb3494e8eac24b07..840c7f260acf6dec57d205f362176b451dfbd648 100644 --- a/go-apps/meep-app-enablement/server/capif-mgmt/model_service_api_description.go +++ b/go-apps/meep-app-enablement/server/capif-mgmt/model_service_api_description.go @@ -14,6 +14,7 @@ type ServiceApiDescription struct { ApiName string `json:"apiName,omitempty"` // If present, shall be set to the value of the \"serInstanceId\" attribute as defined in clause 8.1.2.2. ApiId string `json:"apiId,omitempty"` - + // AEF profile information, which includes the exposed API details (e.g., protocol). For CAPIF-4/4e interface, API publishing function shall provide this attribute to the CCF in service API publishing. For CAPIF-1/1e interface, the CCF shall provide this attribute to the API Invoker during service API discovery. + AefProfiles []AefProfile `json:"aefProfiles,omitempty"` VendorSpecificUrnetsimeccapifextserviceInfo *MecServiceInfoCapifExt `json:"vendorSpecific-urn:etsi:mec:capifext:service-info,omitempty"` } diff --git a/go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go b/go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go index fd7bf8e4df4cdb56bdd43eca34bfedd420c9f99a..740820d998714a250a4ee45802a0d0a6c66a2484 100644 --- a/go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go +++ b/go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go @@ -1318,9 +1318,22 @@ func getServices(w http.ResponseWriter, r *http.Request, appId string) { // Map ServiceInfoList to ServiceApiDescription list serviceApiDescriptions := make([]ServiceApiDescription, 0) for _, service := range sInfoList.Services { + aefProfile := AefProfile{ + AefId: service.TransportInfo.Id, + Versions: []string{service.Version}, // Assuming service.Version is a string, wrap it in a slice + InterfaceDescriptions: service.TransportInfo.Endpoint, + VendorSpecificUrnetsimeccapifexttransportInfo: &MecTransportInfoCapifExt{ + Name: service.TransportInfo.Name, + Type_: service.TransportInfo.Type_, + Protocol: service.TransportInfo.Protocol, + Version: service.TransportInfo.Version, + Security: service.TransportInfo.Security, + }, + } apiDesc := ServiceApiDescription{ - ApiName: service.SerName, - ApiId: service.SerInstanceId, + ApiName: service.SerName, + ApiId: service.SerInstanceId, + AefProfiles: []AefProfile{aefProfile}, VendorSpecificUrnetsimeccapifextserviceInfo: &MecServiceInfoCapifExt{ Serializer: service.Serializer, State: service.State,