Commit 6c1168bd authored by Ikram Haq's avatar Ikram Haq
Browse files

Add aef_profile data model for serv-mgmt

parent 8bbf1223
Loading
Loading
Loading
Loading
+188 −0
Original line number Diff line number Diff line
@@ -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
+21 −0
Original line number Diff line number Diff line
/*
 * 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"`
}
+29 −0
Original line number Diff line number Diff line
/*
 * 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
+2 −1
Original line number Diff line number Diff line
@@ -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"`
}
+15 −2
Original line number Diff line number Diff line
@@ -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,
			AefProfiles: []AefProfile{aefProfile},
			VendorSpecificUrnetsimeccapifextserviceInfo: &MecServiceInfoCapifExt{
				Serializer:        service.Serializer,
				State:             service.State,