Activity log for bug #2059754

Date Who What changed Old value New value Message
2024-03-29 07:21:16 Masaki UENO bug added bug
2024-03-29 07:28:03 Masaki UENO description In the Tacker Antelope implement, schema definition of `CpProtocolData` has a wrong enum definition, which causes validation error when a LCM request sent. When an InstantiateVnfRequest is sent from a client to Tacker, the client received 400 Bad Request. ``` {"status": 400, "detail": "Invalid input for field/attribute layerProtocol. Value: IP_OVER_ETHERNET. 'IP_OVER_ETHERNET' is not one of 'IP_OVER_ETHERNET'", "title": "Bad Request"} ``` Parameter of InstantiateVnfRequest is as follows: ``` { "flavourId": "simple", "instantiationLevelId": "instantiation_level_1", "extVirtualLinks": [ { "id": "270f1e37-0d38-4e75-869a-158737d48a1a", "resourceId": "270f1e37-0d38-4e75-869a-158737d48a1a", "extCps": [ { "cpdId": "VDU1_CP1", "cpConfig": { "VDU1_CP1": { "cpProtocolData": [ { "layerProtocol": "IP_OVER_ETHERNET", "ipOverEthernet": { "ipAddresses": [ { "type": "IPV4", "numDynamicAddresses": 1 } ] } } ] } } }, { "cpdId": "VDU2_CP1", "cpConfig": { "VDU2_CP1": { "cpProtocolData": [ { "layerProtocol": "IP_OVER_ETHERNET", "ipOverEthernet": { "ipAddresses": [ { "type": "IPV4", "fixedAddresses": [ "192.168.200.101" ] } ] } } ] } } } ] } ] } ``` In the sample described in JSON schema document[1], value type of "enum" is array. However, JSON schema of CpProtocolData is defined as follows[2]: ``` CpProtocolData = { 'type': 'object', 'properties': { 'layerProtocol': { 'type': 'string', 'enum': 'IP_OVER_ETHERNET'}, 'ipOverEthernet': IpOverEthernetAddressData, }, 'required': ['layerProtocol'], 'additionalProperties': True, } ``` I think the root cause of this behavior is that `properties.layerProtocol.enum` is not defined as array, thus the following will resolve this issue. ``` CpProtocolData = { 'type': 'object', 'properties': { 'layerProtocol': { 'type': 'string', 'enum': ['IP_OVER_ETHERNET']}, 'ipOverEthernet': IpOverEthernetAddressData, }, 'required': ['layerProtocol'], 'additionalProperties': True, } ``` --- References --- [1] https://json-schema.org/understanding-json-schema/reference/enum [2] https://opendev.org/openstack/tacker/src/branch/stable/2023.1/tacker/sol_refactored/api/schemas/common_types.py#L194-L199 In the Tacker Antelope implementation, schema definition of `CpProtocolData` has a wrong enum definition, which causes validation error when a LCM request sent. When an InstantiateVnfRequest is sent from a client to Tacker, the client received 400 Bad Request. ``` {"status": 400, "detail": "Invalid input for field/attribute layerProtocol. Value: IP_OVER_ETHERNET. 'IP_OVER_ETHERNET' is not one of 'IP_OVER_ETHERNET'", "title": "Bad Request"} ``` Parameter of InstantiateVnfRequest is as follows: ``` {   "flavourId": "simple",   "instantiationLevelId": "instantiation_level_1",   "extVirtualLinks": [     {       "id": "270f1e37-0d38-4e75-869a-158737d48a1a",       "resourceId": "270f1e37-0d38-4e75-869a-158737d48a1a",       "extCps": [         {           "cpdId": "VDU1_CP1",           "cpConfig": {             "VDU1_CP1": {               "cpProtocolData": [                 {                   "layerProtocol": "IP_OVER_ETHERNET",                   "ipOverEthernet": {                     "ipAddresses": [                       {                         "type": "IPV4",                         "numDynamicAddresses": 1                       }                     ]                   }                 }               ]             }           }         },         {           "cpdId": "VDU2_CP1",           "cpConfig": {             "VDU2_CP1": {               "cpProtocolData": [                 {                   "layerProtocol": "IP_OVER_ETHERNET",                   "ipOverEthernet": {                     "ipAddresses": [                       {                         "type": "IPV4",                         "fixedAddresses": [                           "192.168.200.101"                         ]                       }                     ]                   }                 }               ]             }           }         }       ]     }   ] } ``` In the sample described in JSON schema document[1], value type of "enum" is array. However, JSON schema of CpProtocolData is defined as follows[2]: ``` CpProtocolData = {     'type': 'object',     'properties': {         'layerProtocol': {             'type': 'string',             'enum': 'IP_OVER_ETHERNET'},         'ipOverEthernet': IpOverEthernetAddressData,     },     'required': ['layerProtocol'],     'additionalProperties': True, } ``` I think the root cause of this behavior is that `properties.layerProtocol.enum` is not defined as array, thus the following will resolve this issue. ``` CpProtocolData = {     'type': 'object',     'properties': {         'layerProtocol': {             'type': 'string',             'enum': ['IP_OVER_ETHERNET']},         'ipOverEthernet': IpOverEthernetAddressData,     },     'required': ['layerProtocol'],     'additionalProperties': True, } ``` --- References --- [1] https://json-schema.org/understanding-json-schema/reference/enum [2] https://opendev.org/openstack/tacker/src/branch/stable/2023.1/tacker/sol_refactored/api/schemas/common_types.py#L194-L199
2024-03-29 07:39:00 Masaki UENO description In the Tacker Antelope implementation, schema definition of `CpProtocolData` has a wrong enum definition, which causes validation error when a LCM request sent. When an InstantiateVnfRequest is sent from a client to Tacker, the client received 400 Bad Request. ``` {"status": 400, "detail": "Invalid input for field/attribute layerProtocol. Value: IP_OVER_ETHERNET. 'IP_OVER_ETHERNET' is not one of 'IP_OVER_ETHERNET'", "title": "Bad Request"} ``` Parameter of InstantiateVnfRequest is as follows: ``` {   "flavourId": "simple",   "instantiationLevelId": "instantiation_level_1",   "extVirtualLinks": [     {       "id": "270f1e37-0d38-4e75-869a-158737d48a1a",       "resourceId": "270f1e37-0d38-4e75-869a-158737d48a1a",       "extCps": [         {           "cpdId": "VDU1_CP1",           "cpConfig": {             "VDU1_CP1": {               "cpProtocolData": [                 {                   "layerProtocol": "IP_OVER_ETHERNET",                   "ipOverEthernet": {                     "ipAddresses": [                       {                         "type": "IPV4",                         "numDynamicAddresses": 1                       }                     ]                   }                 }               ]             }           }         },         {           "cpdId": "VDU2_CP1",           "cpConfig": {             "VDU2_CP1": {               "cpProtocolData": [                 {                   "layerProtocol": "IP_OVER_ETHERNET",                   "ipOverEthernet": {                     "ipAddresses": [                       {                         "type": "IPV4",                         "fixedAddresses": [                           "192.168.200.101"                         ]                       }                     ]                   }                 }               ]             }           }         }       ]     }   ] } ``` In the sample described in JSON schema document[1], value type of "enum" is array. However, JSON schema of CpProtocolData is defined as follows[2]: ``` CpProtocolData = {     'type': 'object',     'properties': {         'layerProtocol': {             'type': 'string',             'enum': 'IP_OVER_ETHERNET'},         'ipOverEthernet': IpOverEthernetAddressData,     },     'required': ['layerProtocol'],     'additionalProperties': True, } ``` I think the root cause of this behavior is that `properties.layerProtocol.enum` is not defined as array, thus the following will resolve this issue. ``` CpProtocolData = {     'type': 'object',     'properties': {         'layerProtocol': {             'type': 'string',             'enum': ['IP_OVER_ETHERNET']},         'ipOverEthernet': IpOverEthernetAddressData,     },     'required': ['layerProtocol'],     'additionalProperties': True, } ``` --- References --- [1] https://json-schema.org/understanding-json-schema/reference/enum [2] https://opendev.org/openstack/tacker/src/branch/stable/2023.1/tacker/sol_refactored/api/schemas/common_types.py#L194-L199 In the Tacker Antelope implementation, schema definition of `CpProtocolData` has a wrong enum definition, which causes validation error when a LCM request is sent from clients. When an InstantiateVnfRequest is sent from a client to Tacker, the client received 400 Bad Request. ``` {"status": 400, "detail": "Invalid input for field/attribute layerProtocol. Value: IP_OVER_ETHERNET. 'IP_OVER_ETHERNET' is not one of 'IP_OVER_ETHERNET'", "title": "Bad Request"} ``` Parameter of InstantiateVnfRequest is as follows: ``` {   "flavourId": "simple",   "instantiationLevelId": "instantiation_level_1",   "extVirtualLinks": [     {       "id": "270f1e37-0d38-4e75-869a-158737d48a1a",       "resourceId": "270f1e37-0d38-4e75-869a-158737d48a1a",       "extCps": [         {           "cpdId": "VDU1_CP1",           "cpConfig": {             "VDU1_CP1": {               "cpProtocolData": [                 {                   "layerProtocol": "IP_OVER_ETHERNET",                   "ipOverEthernet": {                     "ipAddresses": [                       {                         "type": "IPV4",                         "numDynamicAddresses": 1                       }                     ]                   }                 }               ]             }           }         },         {           "cpdId": "VDU2_CP1",           "cpConfig": {             "VDU2_CP1": {               "cpProtocolData": [                 {                   "layerProtocol": "IP_OVER_ETHERNET",                   "ipOverEthernet": {                     "ipAddresses": [                       {                         "type": "IPV4",                         "fixedAddresses": [                           "192.168.200.101"                         ]                       }                     ]                   }                 }               ]             }           }         }       ]     }   ] } ``` In the sample described in JSON schema document[1], value type of "enum" is array. However, JSON schema of CpProtocolData is defined as follows[2]: ``` CpProtocolData = {     'type': 'object',     'properties': {         'layerProtocol': {             'type': 'string',             'enum': 'IP_OVER_ETHERNET'},         'ipOverEthernet': IpOverEthernetAddressData,     },     'required': ['layerProtocol'],     'additionalProperties': True, } ``` I think the root cause of this behavior is that `properties.layerProtocol.enum` is not defined as array, thus the following will resolve this issue. ``` CpProtocolData = {     'type': 'object',     'properties': {         'layerProtocol': {             'type': 'string',             'enum': ['IP_OVER_ETHERNET']},         'ipOverEthernet': IpOverEthernetAddressData,     },     'required': ['layerProtocol'],     'additionalProperties': True, } ``` --- References --- [1] https://json-schema.org/understanding-json-schema/reference/enum [2] https://opendev.org/openstack/tacker/src/branch/stable/2023.1/tacker/sol_refactored/api/schemas/common_types.py#L194-L199
2024-04-01 05:31:22 OpenStack Infra tacker: status New In Progress
2024-04-01 21:56:48 Itsuro Oda tacker: assignee Itsuro Oda (oda-g)