Commit 90f0a034 authored by Filipe Ferreira's avatar Filipe Ferreira
Browse files

wip.

parent 11478dee
Loading
Loading
Loading
Loading
+597 −0

File added.

Preview size limit exceeded, changes collapsed.

+52 −0
Original line number Original line Diff line number Diff line
@@ -167,4 +167,56 @@ module AppEnablementAPI_Templates {
    serviceCont := p_service_cont
    serviceCont := p_service_cont
  } // End of template mw_app_charcs
  } // End of template mw_app_charcs


  template (value) ServiceInfo m_service_info(
                                          in template (value) SerInstanceId p_ser_instance_id,  // TODO optional parameters need anything special?
                                          in template (value) SerName p_ser_name,
                                          in template (value) CategoryRef p_ser_category,
                                          in template (value) Version p_version,
                                          in template (value) ServiceState p_state,
                                          in template (value) TransportId p_transport_id,
                                          in template (value) TransportInfo p_transport_info,
                                          in template (value) SerializerTypes p_serializer,
                                          in template (value) LocalityTypes p_scope_of_locality,
                                          in template (value) Bool p_consumed_local_only,
                                          in template (value) Bool p_is_local
                                          ) := {
    serInstanceId     := p_ser_instance_id,
    serName           := p_ser_name,
    serCategory       := p_ser_category,
    version           := p_version,
    state             := p_state,
    transportId       := p_transport_id,
    transportInfo     := p_transport_info,
    serializer        := p_serializer,
    scopeOfLocality   := p_scope_of_locality,
    consumedLocalOnly := p_consumed_local_only,
    isLocal           := p_is_local
  } // End of template m_service_info

  template (present) ServiceInfo mw_service_info(
                                          template (present) SerInstanceId p_ser_instance_id := ?,  // TODO optional parameters need anything special?
                                          template (present) SerName p_ser_name := ?,
                                          template (present) CategoryRef p_ser_category := ?,
                                          template (present) Version p_version := ?,
                                          template (present) ServiceState p_state := ?,
                                          template (present) TransportId p_transport_id := ?,
                                          template (present) TransportInfo p_transport_info := ?,
                                          template (present) SerializerTypes p_serializer := ?,
                                          template (present) LocalityTypes p_scope_of_locality := ?,
                                          template (present) Bool p_consumed_local_only := ?,
                                          template (present) Bool p_is_local := ?
                                          ) := {
    serInstanceId     := p_ser_instance_id,
    serName           := p_ser_name,
    serCategory       := p_ser_category,
    version           := p_version,
    state             := p_state,
    transportId       := p_transport_id,
    transportInfo     := p_transport_info,
    serializer        := p_serializer,
    scopeOfLocality   := p_scope_of_locality,
    consumedLocalOnly := p_consumed_local_only,
    isLocal           := p_is_local
  } // End of template mw_service_info

} // End of module AppEnablementAPI_Templates
} // End of module AppEnablementAPI_Templates
+216 −2
Original line number Original line Diff line number Diff line
@@ -6,7 +6,6 @@ module AppEnablementAPI_TypesAndValues {


  // JSON
  // JSON
  import from JSON all;
  import from JSON all;
 
  // LibCommon
  // LibCommon
  import from LibCommon_BasicTypesAndValues all;
  import from LibCommon_BasicTypesAndValues all;


@@ -183,6 +182,221 @@ module AppEnablementAPI_TypesAndValues {
   */
   */
  type JSON.AnyURI AppPackageSource;
  type JSON.AnyURI AppPackageSource;


  /**
   * @desc Identifier (UUID, IETF RFC 4122) of the service instance assigned by the MEPM/MEC platform. The length of the value shall not exceed 36 characters.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.2.2  Type: ServiceInfo
   */
  type JSON.String SerInstanceId length(1..36) with {encode "length(1..36)"};

  /**
   * @desc The name of the service. This is how the service producing MEC application identifies the service instance it produces. The length of the value shall not exceed 32 characters.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.2.2  Type: ServiceInfo
   */
  type JSON.String SerName length(1..32) with {encode "length(1..32)"};

  /**
   * @desc The version of the service. The length of the value shall not exceed 32 characters.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.2.2  Type: ServiceInfo
   */
  // TODO what's the length here? not defined in the spec.
  type JSON.String Version length(1..32) with {encode "length(1..32)"};

  /**
   * @desc The service state
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.2.2  Type: ServiceInfo
   */
  type enumerated ServiceState {
    ACTIVE,
    INACTIVE,
    INVALID_STATE // Used for BI tests
  }

  /**
   * @desc The version of the service. The length of the value shall not exceed 32 characters.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.2.2  Type: ServiceInfo
   */
  // TODO what's the length here? not defined in the spec.
  type JSON.String TransportId length(1..32) with {encode "length(1..32)"};

  /**
   * @desc A generic identifier. The length of the value shall not exceed 32 characters.
   */
  // TODO what's the length here? not defined in the spec.
  type JSON.String Identifier length(1..32) with {encode "length(1..32)"};

  /**
   * @desc Address of the user application. Used as the reference URL for the application. Assigned by the MEC system and included in the response.
   */
  type JSON.AnyURI URI;

  /**
   * @desc A generic name. The length of the value shall not exceed 32 characters.
   */
  // TODO what's the length here? not defined in the spec.
  type JSON.String Name length(1..32) with {encode "length(1..32)"};

  /**
   * @desc A generic string. The length of the value shall not exceed 32 characters.
   */
  // TODO will we define generic string type or a type for every string field.
  type JSON.String String32 length(1..32) with {encode "length(1..32)"};

  /**
   * @desc A generic string. The length of the value shall not exceed 255 characters.
   */
  // TODO will we define generic string type or a type for every string field.
  type JSON.String String255 length(1..255) with {encode "length(1..255)"};

  /**
   * @desc List of available MEC Services.
   */
  type record length(0..infinity) of ServiceInfo ServiceInfoList;

  /**
   * @desc General information of a MEC service.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.2.2  Type: ServiceInfo
   */
  type record ServiceInfo {
    SerInstanceId serInstanceId optional,
    SerName serName,
    CategoryRef serCategory,
    Version version,
    ServiceState state,
    TransportId transportId,
    TransportInfo transportInfo optional,
    SerializerTypes serializer,
    LocalityTypes scopeOfLocality optional,
    Bool consumedLocalOnly optional,
    Bool isLocal optional
  }

  /**
   * @desc Category reference for a MEC service.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.5.2  Type: CategoryRef
   */
  type record CategoryRef {
    URI href,
    Identifier id,
    Name name,
    Version version
  }

  /**
   * @desc Transport information for a MEC service.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.2.3  Type: TransportInfo
   */
  type record TransportInfo {
    Identifier id,
    String32 name,
    String32 description,
    TransportTypes transportType,
    String32 protocol,
    Version version,
    EndPointInfo endPoint,
    SecurityInfo security,
    Not specified implSpecificInfo optional  // TODO spec doesn't specify the type, can be anything if present. How to code it?
  }

  /**
   * @desc The types of transports.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.6.4  Type: TransportTypes
   */
  type enumerated TransportTypes {
    REST_HTTP,
    MB_TOPIC_BASED,
    MB_ROUTING,
    MB_PUBSUB,
    RPC,
    RPC_STREAMING,
    WEBSOCKET,
    INVALID_TYPE // Used for BI tests
  }

  /**
   * @desc The information about a transport endpoint.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.5.3  Type: EndPointInfo
   */
  type record EndPointInfo {
    String255 uris,
    EndPointAddressList addresses,
    Not specified alternative optional  // TODO spec doesn't specify the type, can be anything if present. How to code it?
  }

  /**
   * @desc The entry point information of the service (IP address and port).
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.5.3  Type: addresses
   */
  type record EndPointAddress {
    String255 host,
    Identifier portNr
  }

  /**
   * @desc Entry point information of the service as one or more pairs of IP address and port.
   */
  type record length(0..infinity) of EndPointAddress EndPointAddressList;

  /**
   * @desc The security information related to a transport.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.5.4  Type: SecurityInfo
   */
  type record SecurityInfo {
    OAuth2Info oAuth2Info,
    Not specified extensions optional  // TODO spec doesn't specify the type, can be anything if present. How to code it?
  }

  /**
   * @desc The Parameters related to use of OAuth 2.0.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.5.4  Type: OAuth2Info
   */
  type record OAuth2Info {
    GrantTypesList grantTypes,
    tokenEndpoint optional,
    Not specified extensions optional  // TODO spec doesn't specify the type, can be anything if present. How to code it?
  }

  /**
   * @desc The supported OAuth 2.0 grant types.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.5.4  Type: grantTypes
   */
  type enumerated GrantType {
    OAUTH2_AUTHORIZATION_CODE,
    OAUTH2_IMPLICIT_GRANT,
    OAUTH2_RESOURCE_OWNER,
    OAUTH2_CLIENT_CREDENTIALS,
    INVALID_GRANT // Used for BI tests
  }

  /**
   * @desc The list of supported OAuth 2.0 grant types.
   */
  type record length(1..4) of GrantType GrantTypesList;

  /**
   * @desc The types of serializers.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.6.3  Type: SerializerTypes
   */
  type enumerated SerializerTypes {
    JSON,
    XML,
    PROTOBUF3,
    INVALID_TYPE // Used for BI tests
  }

  /**
   * @desc The types of locality.
   * @see ETSI GS MEC 011 V2.0.8 Clause 6.6.5  Type: LocalityTypes
   */
  type enumerated LocalityTypes {
    MEC_SYSTEM,
    MEC_HOST,
    NFVI_POP,
    ZONE,
    ZONE_GROUP,
    NFVI_NODE,
    INVALID_TYPE // Used for BI tests
  }

} with {
} with {
  encode "JSON"
  encode "JSON"
} // End of module AppEnablementAPI_TypesAndValues
} // End of module AppEnablementAPI_TypesAndValues
+4 −0
Original line number Original line Diff line number Diff line
@@ -18,4 +18,8 @@ module LibMec_Pixits {
  
  
  modulepar charstring PX_ME_BWM_URI := "/bwm/v2/bw_allocations";
  modulepar charstring PX_ME_BWM_URI := "/bwm/v2/bw_allocations";


  // TODO this should be /mec_service_mgmt/v1/applications/{APP_INSTANCE_ID}/services. can't this be done as
  // a string format instead of the string concatenation in the test? 
  modulepar charstring PX_ME_APP_ENABLEMENT_URI := "/mec_service_mgmt/v1/applications";

} // End of module LibMec_Pixits 
} // End of module LibMec_Pixits 
+3 −0
Original line number Original line Diff line number Diff line
@@ -8,6 +8,8 @@ module LibItsHttp_JsonMessageBodyTypes {
  import from RnisAPI_TypesAndValues all;
  import from RnisAPI_TypesAndValues all;
  // LibMec/BwManagementApi
  // LibMec/BwManagementApi
  import from BwManagementAPI_TypesAndValues all;
  import from BwManagementAPI_TypesAndValues all;
  // LibMec/AppEnablementAPI
  import from AppEnablementAPI_TypesAndValues all;
 
 
  /**
  /**
   * This file volontary contains a trivial declaration of the type JsonBody. 
   * This file volontary contains a trivial declaration of the type JsonBody. 
@@ -30,6 +32,7 @@ module LibItsHttp_JsonMessageBodyTypes {
    RnisAPI_TypesAndValues.ProblemDetails          problemDetails_rnis,
    RnisAPI_TypesAndValues.ProblemDetails          problemDetails_rnis,
    BwInfo                                         bwInfo,
    BwInfo                                         bwInfo,
    BwManagementAPI_TypesAndValues.ProblemDetails  problemDetails_bw_management,
    BwManagementAPI_TypesAndValues.ProblemDetails  problemDetails_bw_management,
    ServiceInfoList                                service_info_list,
    universal charstring                           raw
    universal charstring                           raw
  } with {
  } with {
    variant ""
    variant ""
Loading