Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-NRF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-NRF
Commits
b84d1cd8
Commit
b84d1cd8
authored
Jan 17, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add OAI header
parent
3a268d4e
Changes
16
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
521 additions
and
372 deletions
+521
-372
src/api-server/impl/AccessTokenRequestApiImpl.cpp
src/api-server/impl/AccessTokenRequestApiImpl.cpp
+29
-7
src/api-server/impl/AccessTokenRequestApiImpl.h
src/api-server/impl/AccessTokenRequestApiImpl.h
+38
-14
src/api-server/impl/CompleteStoredSearchDocumentApiImpl.cpp
src/api-server/impl/CompleteStoredSearchDocumentApiImpl.cpp
+44
-23
src/api-server/impl/CompleteStoredSearchDocumentApiImpl.h
src/api-server/impl/CompleteStoredSearchDocumentApiImpl.h
+40
-18
src/api-server/impl/DiscNFInstancesStoreApiImpl.cpp
src/api-server/impl/DiscNFInstancesStoreApiImpl.cpp
+89
-67
src/api-server/impl/DiscNFInstancesStoreApiImpl.h
src/api-server/impl/DiscNFInstancesStoreApiImpl.h
+86
-62
src/api-server/impl/NFInstanceIDDocumentApiImpl.cpp
src/api-server/impl/NFInstanceIDDocumentApiImpl.cpp
+26
-26
src/api-server/impl/NFInstanceIDDocumentApiImpl.h
src/api-server/impl/NFInstanceIDDocumentApiImpl.h
+30
-26
src/api-server/impl/NFInstancesStoreApiImpl.cpp
src/api-server/impl/NFInstancesStoreApiImpl.cpp
+10
-10
src/api-server/impl/NFInstancesStoreApiImpl.h
src/api-server/impl/NFInstancesStoreApiImpl.h
+21
-18
src/api-server/impl/StoredSearchDocumentApiImpl.cpp
src/api-server/impl/StoredSearchDocumentApiImpl.cpp
+25
-27
src/api-server/impl/StoredSearchDocumentApiImpl.h
src/api-server/impl/StoredSearchDocumentApiImpl.h
+20
-18
src/api-server/impl/SubscriptionIDDocumentApiImpl.cpp
src/api-server/impl/SubscriptionIDDocumentApiImpl.cpp
+11
-11
src/api-server/impl/SubscriptionIDDocumentApiImpl.h
src/api-server/impl/SubscriptionIDDocumentApiImpl.h
+25
-21
src/api-server/impl/SubscriptionsCollectionApiImpl.cpp
src/api-server/impl/SubscriptionsCollectionApiImpl.cpp
+6
-6
src/api-server/impl/SubscriptionsCollectionApiImpl.h
src/api-server/impl/SubscriptionsCollectionApiImpl.h
+21
-18
No files found.
src/api-server/impl/AccessTokenRequestApiImpl.cpp
View file @
b84d1cd8
...
@@ -11,6 +11,28 @@
...
@@ -11,6 +11,28 @@
* the class manually.
* the class manually.
*/
*/
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "AccessTokenRequestApiImpl.h"
#include "AccessTokenRequestApiImpl.h"
#include "3gpp_29.500.h"
#include "3gpp_29.500.h"
#include "AccessTokenRsp.h"
#include "AccessTokenRsp.h"
...
@@ -26,13 +48,13 @@ using namespace oai::nrf::app;
...
@@ -26,13 +48,13 @@ using namespace oai::nrf::app;
using
namespace
oai
::
nrf
::
helpers
;
using
namespace
oai
::
nrf
::
helpers
;
AccessTokenRequestApiImpl
::
AccessTokenRequestApiImpl
(
AccessTokenRequestApiImpl
::
AccessTokenRequestApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
std
::
string
address
)
:
AccessTokenRequestApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
m_address
(
address
)
{}
:
AccessTokenRequestApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
m_address
(
address
)
{}
void
AccessTokenRequestApiImpl
::
access_token_request
(
void
AccessTokenRequestApiImpl
::
access_token_request
(
const
Pistache
::
Rest
::
Request
&
request
,
const
Pistache
::
Rest
::
Request
&
request
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Logger
::
nrf_sbi
().
info
(
Logger
::
nrf_sbi
().
info
(
"Got a request to request an OAuth2 access token from the authorization "
"Got a request to request an OAuth2 access token from the authorization "
"server (NRF)"
);
"server (NRF)"
);
...
@@ -42,8 +64,8 @@ void AccessTokenRequestApiImpl::access_token_request(
...
@@ -42,8 +64,8 @@ void AccessTokenRequestApiImpl::access_token_request(
int
http_code
=
0
;
int
http_code
=
0
;
ProblemDetails
problem_details
=
{};
ProblemDetails
problem_details
=
{};
AccessTokenRsp
access_token_rsp
=
{};
AccessTokenRsp
access_token_rsp
=
{};
m_nrf_app
->
handle_access_token_request
(
request
.
body
(),
access_token_rsp
,
m_nrf_app
->
handle_access_token_request
(
http_code
,
1
,
problem_details
);
request
.
body
(),
access_token_rsp
,
http_code
,
1
,
problem_details
);
nlohmann
::
json
json_data
=
{};
nlohmann
::
json
json_data
=
{};
std
::
string
content_type
=
"application/json"
;
std
::
string
content_type
=
"application/json"
;
...
...
src/api-server/impl/AccessTokenRequestApiImpl.h
View file @
b84d1cd8
/**
/**
* NRF OAuth2
* NRF OAuth2
* NRF OAuth2 Authorization. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* NRF OAuth2 Authorization. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
*
* The version of the OpenAPI document: 1.0.2
* The version of the OpenAPI document: 1.0.2
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* NOTE: This class is auto generated by OpenAPI Generator
* https://openapi-generator.tech
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* Do not edit the class manually.
* the class manually.
*/
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
*/
/*
/*
...
@@ -45,20 +67,22 @@ using namespace oai::nrf::app;
...
@@ -45,20 +67,22 @@ using namespace oai::nrf::app;
class
AccessTokenRequestApiImpl
:
public
oai
::
nrf
::
api
::
AccessTokenRequestApi
{
class
AccessTokenRequestApiImpl
:
public
oai
::
nrf
::
api
::
AccessTokenRequestApi
{
public:
public:
AccessTokenRequestApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
AccessTokenRequestApiImpl
(
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
nrf_app
*
nrf_app_inst
,
~
AccessTokenRequestApiImpl
()
{
std
::
string
address
);
}
~
AccessTokenRequestApiImpl
()
{}
void
access_token_request
(
const
Pistache
::
Rest
::
Request
&
request
,
Pistache
::
Http
::
ResponseWriter
&
response
);
void
access_token_request
(
const
Pistache
::
Rest
::
Request
&
request
,
Pistache
::
Http
::
ResponseWriter
&
response
);
private:
private:
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
std
::
string
m_address
;
};
};
}
}
// namespace api
}
}
// namespace nrf
}
}
// namespace oai
#endif
#endif
src/api-server/impl/CompleteStoredSearchDocumentApiImpl.cpp
View file @
b84d1cd8
/**
/**
* NRF NFDiscovery Service
* NRF NFDiscovery Service
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
*
* The version of the OpenAPI document: 1.1.0.alpha-1
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator
(https://openapi-generator.tech).
* NOTE: This class is auto generated by OpenAPI Generator
*
https://openapi-generator.tech
*
(https://openapi-generator.tech). https://openapi-generator.tech Do not edit
*
Do not edit
the class manually.
* the class manually.
*/
*/
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#include "CompleteStoredSearchDocumentApiImpl.h"
#include "CompleteStoredSearchDocumentApiImpl.h"
#include "3gpp_29.500.h"
#include "3gpp_29.500.h"
...
@@ -21,46 +44,44 @@ using namespace oai::nrf::model;
...
@@ -21,46 +44,44 @@ using namespace oai::nrf::model;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
::
app
;
CompleteStoredSearchDocumentApiImpl
::
CompleteStoredSearchDocumentApiImpl
(
CompleteStoredSearchDocumentApiImpl
::
CompleteStoredSearchDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
std
::
string
address
)
:
:
CompleteStoredSearchDocumentApi
(
rtr
),
CompleteStoredSearchDocumentApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
m_nrf_app
(
nrf_app_inst
),
m_address
(
address
)
{
m_address
(
address
)
{}
}
void
CompleteStoredSearchDocumentApiImpl
::
retrieve_complete_search
(
void
CompleteStoredSearchDocumentApiImpl
::
retrieve_complete_search
(
const
std
::
string
&
searchId
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
const
std
::
string
&
searchId
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Logger
::
nrf_sbi
().
info
(
Logger
::
nrf_sbi
().
info
(
"Got a request to retrieve a complete search with ID %s"
,
"Got a request to retrieve a complete search with ID %s"
,
searchId
.
c_str
());
searchId
.
c_str
());
nlohmann
::
json
sr_json
=
{
};
nlohmann
::
json
sr_json
=
{
};
nlohmann
::
json
json_data
=
{
};
nlohmann
::
json
json_data
=
{};
json_data
[
"nfInstances"
]
=
nlohmann
::
json
::
array
();
json_data
[
"nfInstances"
]
=
nlohmann
::
json
::
array
();
std
::
string
content_type
=
"application/json"
;
std
::
string
content_type
=
"application/json"
;
std
::
shared_ptr
<
nrf_search_result
>
search_result
=
{
};
std
::
shared_ptr
<
nrf_search_result
>
search_result
=
{};
m_nrf_app
->
find_search_result
(
searchId
,
search_result
);
m_nrf_app
->
find_search_result
(
searchId
,
search_result
);
// convert the profile to Json
// convert the profile to Json
if
(
search_result
!=
nullptr
)
{
if
(
search_result
!=
nullptr
)
{
search_result
.
get
()
->
to_json
(
sr_json
,
0
);
//with maximum number of NF profiles
search_result
.
get
()
->
to_json
(
sr_json
,
0
);
// with maximum number of NF profiles
json_data
[
"nfInstances"
]
=
sr_json
[
"nfInstances"
];
json_data
[
"nfInstances"
]
=
sr_json
[
"nfInstances"
];
}
}
Logger
::
nrf_sbi
().
debug
(
"Json data: %s"
,
json_data
.
dump
().
c_str
());
Logger
::
nrf_sbi
().
debug
(
"Json data: %s"
,
json_data
.
dump
().
c_str
());
// content type
// content type
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
ContentType
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
ContentType
>
(
>
(
Pistache
::
Http
::
Mime
::
MediaType
(
content_type
));
Pistache
::
Http
::
Mime
::
MediaType
(
content_type
));
response
.
send
(
Pistache
::
Http
::
Code
(
HTTP_STATUS_CODE_200_OK
),
json_data
.
dump
().
c_str
());
}
}
response
.
send
(
}
Pistache
::
Http
::
Code
(
HTTP_STATUS_CODE_200_OK
),
json_data
.
dump
().
c_str
());
}
}
}
// namespace api
}
// namespace nrf
}
// namespace oai
src/api-server/impl/CompleteStoredSearchDocumentApiImpl.h
View file @
b84d1cd8
/**
/**
* NRF NFDiscovery Service
* NRF NFDiscovery Service
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
*
* The version of the OpenAPI document: 1.1.0.alpha-1
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* NOTE: This class is auto generated by OpenAPI Generator
* https://openapi-generator.tech
* (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
* Do not edit the class manually.
* the class manually.
*/
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
*/
/*
/*
...
@@ -39,24 +61,24 @@ namespace api {
...
@@ -39,24 +61,24 @@ namespace api {
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
::
app
;
class
CompleteStoredSearchDocumentApiImpl
:
class
CompleteStoredSearchDocumentApiImpl
public
oai
::
nrf
::
api
::
CompleteStoredSearchDocumentApi
{
:
public
oai
::
nrf
::
api
::
CompleteStoredSearchDocumentApi
{
public:
public:
CompleteStoredSearchDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
CompleteStoredSearchDocumentApiImpl
(
nrf_app
*
nrf_app_inst
,
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
std
::
string
address
);
~
CompleteStoredSearchDocumentApiImpl
()
{
~
CompleteStoredSearchDocumentApiImpl
()
{}
}
void
retrieve_complete_search
(
const
std
::
string
&
searchId
,
Pistache
::
Http
::
ResponseWriter
&
response
);
void
retrieve_complete_search
(
const
std
::
string
&
searchId
,
Pistache
::
Http
::
ResponseWriter
&
response
);
private:
private:
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
std
::
string
m_address
;
};
};
}
}
// namespace api
}
}
// namespace nrf
}
}
// namespace oai
#endif
#endif
src/api-server/impl/DiscNFInstancesStoreApiImpl.cpp
View file @
b84d1cd8
This diff is collapsed.
Click to expand it.
src/api-server/impl/DiscNFInstancesStoreApiImpl.h
View file @
b84d1cd8
/**
/**
* NRF NFDiscovery Service
* NRF NFDiscovery Service
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
*
* The version of the OpenAPI document: 1.1.0.alpha-1
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator
(https://openapi-generator.tech).
* NOTE: This class is auto generated by OpenAPI Generator
*
https://openapi-generator.tech
*
(https://openapi-generator.tech). https://openapi-generator.tech Do not edit
*
Do not edit
the class manually.
* the class manually.
*/
*/
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*
/*
* NFInstancesStoreApiImpl.h
* NFInstancesStoreApiImpl.h
*
*
...
@@ -56,70 +79,71 @@ namespace api {
...
@@ -56,70 +79,71 @@ namespace api {
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
::
app
;
class
DiscNFInstancesStoreApiImpl
:
class
DiscNFInstancesStoreApiImpl
public
oai
::
nrf
::
api
::
DiscNFInstancesStoreApi
{
:
public
oai
::
nrf
::
api
::
DiscNFInstancesStoreApi
{
public:
public:
DiscNFInstancesStoreApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
DiscNFInstancesStoreApiImpl
(
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
nrf_app
*
nrf_app_inst
,
~
DiscNFInstancesStoreApiImpl
()
{
std
::
string
address
);
}
~
DiscNFInstancesStoreApiImpl
()
{
}
void
search_nf_instances
(
void
search_nf_instances
(
const
Pistache
::
Optional
<
std
::
string
>
&
targetNfType
,
const
Pistache
::
Optional
<
std
::
string
>&
targetNfType
,
const
Pistache
::
Optional
<
std
::
string
>
&
requesterNfType
,
const
Pistache
::
Optional
<
std
::
string
>&
requesterNfType
,
const
Pistache
::
Optional
<
std
::
string
>
&
requesterNfInstanceId
,
const
Pistache
::
Optional
<
std
::
string
>&
requesterNfInstanceId
,
const
Pistache
::
Optional
<
std
::
vector
<
ServiceName
>>
&
serviceNames
,
const
Pistache
::
Optional
<
std
::
vector
<
ServiceName
>>&
serviceNames
,
const
Pistache
::
Optional
<
std
::
string
>
&
requesterNfInstanceFqdn
,
const
Pistache
::
Optional
<
std
::
string
>&
requesterNfInstanceFqdn
,
const
Pistache
::
Optional
<
std
::
vector
<
PlmnId
>>
&
targetPlmnList
,
const
Pistache
::
Optional
<
std
::
vector
<
PlmnId
>>&
targetPlmnList
,
const
Pistache
::
Optional
<
std
::
vector
<
PlmnId
>>
&
requesterPlmnList
,
const
Pistache
::
Optional
<
std
::
vector
<
PlmnId
>>&
requesterPlmnList
,
const
Pistache
::
Optional
<
std
::
string
>
&
targetNfInstanceId
,
const
Pistache
::
Optional
<
std
::
string
>&
targetNfInstanceId
,
const
Pistache
::
Optional
<
std
::
string
>
&
targetNfFqdn
,
const
Pistache
::
Optional
<
std
::
string
>&
targetNfFqdn
,
const
Pistache
::
Optional
<
std
::
string
>
&
hnrfUri
,
const
Pistache
::
Optional
<
std
::
string
>&
hnrfUri
,
const
Pistache
::
Optional
<
std
::
vector
<
Snssai
>>
&
snssais
,
const
Pistache
::
Optional
<
std
::
vector
<
Snssai
>>&
snssais
,
const
Pistache
::
Optional
<
std
::
vector
<
Snssai
>>
&
requesterSnssais
,
const
Pistache
::
Optional
<
std
::
vector
<
Snssai
>>&
requesterSnssais
,
const
Pistache
::
Optional
<
std
::
vector
<
PlmnSnssai
>>
&
plmnSpecificSnssaiList
,
const
Pistache
::
Optional
<
std
::
vector
<
PlmnSnssai
>>&
plmnSpecificSnssaiList
,
const
Pistache
::
Optional
<
std
::
string
>
&
dnn
,
const
Pistache
::
Optional
<
std
::
string
>&
dnn
,
const
Pistache
::
Optional
<
std
::
vector
<
std
::
string
>>
&
nsiList
,
const
Pistache
::
Optional
<
std
::
vector
<
std
::
string
>>&
nsiList
,
const
Pistache
::
Optional
<
std
::
string
>
&
smfServingArea
,
const
Pistache
::
Optional
<
std
::
string
>&
smfServingArea
,
const
Pistache
::
Optional
<
Tai
>
&
tai
,
const
Pistache
::
Optional
<
Tai
>&
tai
,
const
Pistache
::
Optional
<
std
::
string
>
&
amfRegionId
,
const
Pistache
::
Optional
<
std
::
string
>&
amfRegionId
,
const
Pistache
::
Optional
<
std
::
string
>
&
amfSetId
,
const
Pistache
::
Optional
<
std
::
string
>&
amfSetId
,
const
Pistache
::
Optional
<
Guami
>
&
guami
,
const
Pistache
::
Optional
<
Guami
>&
guami
,
const
Pistache
::
Optional
<
std
::
string
>
&
supi
,
const
Pistache
::
Optional
<
std
::
string
>&
supi
,
const
Pistache
::
Optional
<
std
::
string
>
&
ueIpv4Address
,
const
Pistache
::
Optional
<
std
::
string
>&
ueIpv4Address
,
const
Pistache
::
Optional
<
std
::
string
>
&
ipDomain
,
const
Pistache
::
Optional
<
std
::
string
>&
ipDomain
,
const
Pistache
::
Optional
<
Ipv6Prefix
>
&
ueIpv6Prefix
,
const
Pistache
::
Optional
<
Ipv6Prefix
>&
ueIpv6Prefix
,
const
Pistache
::
Optional
<
bool
>
&
pgwInd
,
const
Pistache
::
Optional
<
bool
>&
pgwInd
,
const
Pistache
::
Optional
<
std
::
string
>
&
pgw
,
const
Pistache
::
Optional
<
std
::
string
>&
pgw
,
const
Pistache
::
Optional
<
std
::
string
>
&
gpsi
,
const
Pistache
::
Optional
<
std
::
string
>&
gpsi
,
const
Pistache
::
Optional
<
std
::
string
>
&
externalGroupIdentity
,
const
Pistache
::
Optional
<
std
::
string
>&
externalGroupIdentity
,
const
Pistache
::
Optional
<
DataSetId
>
&
dataSet
,
const
Pistache
::
Optional
<
DataSetId
>&
dataSet
,
const
Pistache
::
Optional
<
std
::
string
>
&
routingIndicator
,
const
Pistache
::
Optional
<
std
::
string
>&
routingIndicator
,
const
Pistache
::
Optional
<
std
::
vector
<
std
::
string
>>
&
groupIdList
,
const
Pistache
::
Optional
<
std
::
vector
<
std
::
string
>>&
groupIdList
,
const
Pistache
::
Optional
<
std
::
vector
<
std
::
string
>>
&
dnaiList
,
const
Pistache
::
Optional
<
std
::
vector
<
std
::
string
>>&
dnaiList
,
const
Pistache
::
Optional
<
std
::
vector
<
PduSessionType
>>
&
pduSessionTypes
,
const
Pistache
::
Optional
<
std
::
vector
<
PduSessionType
>>&
pduSessionTypes
,
const
Pistache
::
Optional
<
std
::
vector
<
EventId
>>
&
eventIdList
,
const
Pistache
::
Optional
<
std
::
vector
<
EventId
>>&
eventIdList
,
const
Pistache
::
Optional
<
std
::
vector
<
NwdafEvent
>>
&
nwdafEventList
,
const
Pistache
::
Optional
<
std
::
vector
<
NwdafEvent
>>&
nwdafEventList
,
const
Pistache
::
Optional
<
std
::
string
>
&
supportedFeatures
,
const
Pistache
::
Optional
<
std
::
string
>&
supportedFeatures
,
const
Pistache
::
Optional
<
bool
>
&
upfIwkEpsInd
,
const
Pistache
::
Optional
<
bool
>&
upfIwkEpsInd
,
const
Pistache
::
Optional
<
PlmnId
>
&
chfSupportedPlmn
,
const
Pistache
::
Optional
<
PlmnId
>&
chfSupportedPlmn
,
const
Pistache
::
Optional
<
std
::
string
>
&
preferredLocality
,
const
Pistache
::
Optional
<
std
::
string
>&
preferredLocality
,
const
Pistache
::
Optional
<
AccessType
>
&
accessType
,
const
Pistache
::
Optional
<
AccessType
>&
accessType
,
const
Pistache
::
Optional
<
int32_t
>
&
limit
,
const
Pistache
::
Optional
<
int32_t
>&
limit
,
const
Pistache
::
Optional
<
std
::
vector
<
std
::
string
>>
&
requiredFeatures
,
const
Pistache
::
Optional
<
std
::
vector
<
std
::
string
>>&
requiredFeatures
,
const
Pistache
::
Optional
<
ComplexQuery
>
&
complexQuery
,
const
Pistache
::
Optional
<
ComplexQuery
>&
complexQuery
,
const
Pistache
::
Optional
<
int32_t
>
&
maxPayloadSize
,
const
Pistache
::
Optional
<
int32_t
>&
maxPayloadSize
,
const
Pistache
::
Optional
<
AtsssCapability
>
&
atsssCapability
,
const
Pistache
::
Optional
<
AtsssCapability
>&
atsssCapability
,
const
Pistache
::
Optional
<
bool
>
&
upfUeIpAddrInd
,
const
Pistache
::
Optional
<
bool
>&
upfUeIpAddrInd
,
const
Pistache
::
Optional
<
Pistache
::
Http
::
Header
::
Raw
>
&
ifNoneMatch
,
const
Pistache
::
Optional
<
Pistache
::
Http
::
Header
::
Raw
>&
ifNoneMatch
,
Pistache
::
Http
::
ResponseWriter
&
response
);
Pistache
::
Http
::
ResponseWriter
&
response
);
private:
private:
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
std
::
string
m_address
;
};
};
}
}
// namespace api
}
}
// namespace nrf
}
}
// namespace oai
#endif
#endif
src/api-server/impl/NFInstanceIDDocumentApiImpl.cpp
View file @
b84d1cd8
...
@@ -30,7 +30,7 @@ using namespace oai::nrf::app;
...
@@ -30,7 +30,7 @@ using namespace oai::nrf::app;
using
namespace
oai
::
nrf
;
using
namespace
oai
::
nrf
;
NFInstanceIDDocumentApiImpl
::
NFInstanceIDDocumentApiImpl
(
NFInstanceIDDocumentApiImpl
::
NFInstanceIDDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
std
::
string
address
)
:
NFInstanceIDDocumentApi
(
rtr
),
:
NFInstanceIDDocumentApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
m_nrf_app
(
nrf_app_inst
),
...
@@ -38,15 +38,15 @@ NFInstanceIDDocumentApiImpl::NFInstanceIDDocumentApiImpl(
...
@@ -38,15 +38,15 @@ NFInstanceIDDocumentApiImpl::NFInstanceIDDocumentApiImpl(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
NFInstanceIDDocumentApiImpl
::
deregister_nf_instance
(
void
NFInstanceIDDocumentApiImpl
::
deregister_nf_instance
(
const
std
::
string
&
nfInstanceID
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
const
std
::
string
&
nfInstanceID
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Logger
::
nrf_sbi
().
info
(
Logger
::
nrf_sbi
().
info
(
"Got a request to de-register a given NF Instance, Instance ID: %s"
,
"Got a request to de-register a given NF Instance, Instance ID: %s"
,
nfInstanceID
.
c_str
());
nfInstanceID
.
c_str
());
int
http_code
=
0
;
int
http_code
=
0
;
ProblemDetails
problem_details
=
{};
ProblemDetails
problem_details
=
{};
m_nrf_app
->
handle_deregister_nf_instance
(
nfInstanceID
,
http_code
,
1
,
m_nrf_app
->
handle_deregister_nf_instance
(
problem_details
);
nfInstanceID
,
http_code
,
1
,
problem_details
);
nlohmann
::
json
json_data
=
{};
nlohmann
::
json
json_data
=
{};
std
::
string
content_type
=
"application/json"
;
std
::
string
content_type
=
"application/json"
;
...
@@ -68,7 +68,7 @@ void NFInstanceIDDocumentApiImpl::deregister_nf_instance(
...
@@ -68,7 +68,7 @@ void NFInstanceIDDocumentApiImpl::deregister_nf_instance(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
NFInstanceIDDocumentApiImpl
::
get_nf_instance
(
void
NFInstanceIDDocumentApiImpl
::
get_nf_instance
(
const
std
::
string
&
nfInstanceID
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
const
std
::
string
&
nfInstanceID
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Logger
::
nrf_sbi
().
info
(
Logger
::
nrf_sbi
().
info
(
"Got a request to retrieve the profile of a given NF Instance, Instance "
"Got a request to retrieve the profile of a given NF Instance, Instance "
"ID: %s"
,
"ID: %s"
,
...
@@ -77,8 +77,8 @@ void NFInstanceIDDocumentApiImpl::get_nf_instance(
...
@@ -77,8 +77,8 @@ void NFInstanceIDDocumentApiImpl::get_nf_instance(
int
http_code
=
0
;
int
http_code
=
0
;
std
::
shared_ptr
<
nrf_profile
>
profile
=
{};
std
::
shared_ptr
<
nrf_profile
>
profile
=
{};
ProblemDetails
problem_details
=
{};
ProblemDetails
problem_details
=
{};
m_nrf_app
->
handle_get_nf_instance
(
nfInstanceID
,
profile
,
http_code
,
1
,
m_nrf_app
->
handle_get_nf_instance
(
problem_details
);
nfInstanceID
,
profile
,
http_code
,
1
,
problem_details
);
nlohmann
::
json
json_data
=
{};
nlohmann
::
json
json_data
=
{};
std
::
string
content_type
=
"application/json"
;
std
::
string
content_type
=
"application/json"
;
...
@@ -98,9 +98,9 @@ void NFInstanceIDDocumentApiImpl::get_nf_instance(
...
@@ -98,9 +98,9 @@ void NFInstanceIDDocumentApiImpl::get_nf_instance(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
NFInstanceIDDocumentApiImpl
::
register_nf_instance
(
void
NFInstanceIDDocumentApiImpl
::
register_nf_instance
(
const
std
::
string
&
nfInstanceID
,
const
NFProfile
&
nFProfile
,
const
std
::
string
&
nfInstanceID
,
const
NFProfile
&
nFProfile
,
const
Pistache
::
Optional
<
Pistache
::
Http
::
Header
::
Raw
>
&
contentEncoding
,
const
Pistache
::
Optional
<
Pistache
::
Http
::
Header
::
Raw
>
&
contentEncoding
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Logger
::
nrf_sbi
().
info
(
Logger
::
nrf_sbi
().
info
(
"Got a request to register an NF instance/Update an NF instance, "
"Got a request to register an NF instance/Update an NF instance, "
"Instance ID: %s"
,
"Instance ID: %s"
,
...
@@ -108,8 +108,8 @@ void NFInstanceIDDocumentApiImpl::register_nf_instance(
...
@@ -108,8 +108,8 @@ void NFInstanceIDDocumentApiImpl::register_nf_instance(
int
http_code
=
0
;
int
http_code
=
0
;
ProblemDetails
problem_details
=
{};
ProblemDetails
problem_details
=
{};
m_nrf_app
->
handle_register_nf_instance
(
nfInstanceID
,
nFProfile
,
http_code
,
1
,
m_nrf_app
->
handle_register_nf_instance
(
problem_details
);
nfInstanceID
,
nFProfile
,
http_code
,
1
,
problem_details
);
nlohmann
::
json
json_data
=
{};
nlohmann
::
json
json_data
=
{};
std
::
string
content_type
=
"application/json"
;
std
::
string
content_type
=
"application/json"
;
...
@@ -122,9 +122,9 @@ void NFInstanceIDDocumentApiImpl::register_nf_instance(
...
@@ -122,9 +122,9 @@ void NFInstanceIDDocumentApiImpl::register_nf_instance(
}
else
{
}
else
{
std
::
shared_ptr
<
nrf_profile
>
profile
=
std
::
shared_ptr
<
nrf_profile
>
profile
=
m_nrf_app
->
find_nf_profile
(
nfInstanceID
);
m_nrf_app
->
find_nf_profile
(
nfInstanceID
);
if
(
profile
.
get
()
!=
nullptr
)
{
if
(
profile
.
get
()
!=
nullptr
)
{
profile
.
get
()
->
to_json
(
json_data
);
profile
.
get
()
->
to_json
(
json_data
);
//
to_json(json_data, nFProfile);
//
to_json(json_data, nFProfile);
}
}
// Location header
// Location header
...
@@ -141,8 +141,8 @@ void NFInstanceIDDocumentApiImpl::register_nf_instance(
...
@@ -141,8 +141,8 @@ void NFInstanceIDDocumentApiImpl::register_nf_instance(
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
NFInstanceIDDocumentApiImpl
::
update_nf_instance
(
void
NFInstanceIDDocumentApiImpl
::
update_nf_instance
(
const
std
::
string
&
nfInstanceID
,
const
std
::
vector
<
PatchItem
>
&
patchItem
,
const
std
::
string
&
nfInstanceID
,
const
std
::
vector
<
PatchItem
>&
patchItem
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Logger
::
nrf_sbi
().
info
(
""
);
Logger
::
nrf_sbi
().
info
(
""
);
Logger
::
nrf_sbi
().
info
(
Logger
::
nrf_sbi
().
info
(
"Got a request to update an NF instance, Instance ID: %s"
,
"Got a request to update an NF instance, Instance ID: %s"
,
...
@@ -150,8 +150,8 @@ void NFInstanceIDDocumentApiImpl::update_nf_instance(
...
@@ -150,8 +150,8 @@ void NFInstanceIDDocumentApiImpl::update_nf_instance(
int
http_code
=
0
;
int
http_code
=
0
;
ProblemDetails
problem_details
=
{};
ProblemDetails
problem_details
=
{};
m_nrf_app
->
handle_update_nf_instance
(
nfInstanceID
,
patchItem
,
http_code
,
1
,
m_nrf_app
->
handle_update_nf_instance
(
problem_details
);
nfInstanceID
,
patchItem
,
http_code
,
1
,
problem_details
);
nlohmann
::
json
json_data
=
{};
nlohmann
::
json
json_data
=
{};
std
::
string
content_type
=
"application/json"
;
std
::
string
content_type
=
"application/json"
;
...
...
src/api-server/impl/NFInstanceIDDocumentApiImpl.h
View file @
b84d1cd8
/**
/**
* NRF NFManagement Service
* NRF NFManagement Service
* NRF NFManagement Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* NRF NFManagement Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
*
* The version of the OpenAPI document: 1.1.0.alpha-1
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator
(https://openapi-generator.tech).
* NOTE: This class is auto generated by OpenAPI Generator
*
https://openapi-generator.tech
*
(https://openapi-generator.tech). https://openapi-generator.tech Do not edit
*
Do not edit
the class manually.
* the class manually.
*/
*/
/*
/*
...
@@ -42,32 +43,35 @@ namespace api {
...
@@ -42,32 +43,35 @@ namespace api {
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
::
app
;
class
NFInstanceIDDocumentApiImpl
:
class
NFInstanceIDDocumentApiImpl
public
oai
::
nrf
::
api
::
NFInstanceIDDocumentApi
{
:
public
oai
::
nrf
::
api
::
NFInstanceIDDocumentApi
{
public:
public:
NFInstanceIDDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
NFInstanceIDDocumentApiImpl
(
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
nrf_app
*
nrf_app_inst
,
~
NFInstanceIDDocumentApiImpl
()
{
std
::
string
address
);
}
~
NFInstanceIDDocumentApiImpl
()
{
}
void
deregister_nf_instance
(
const
std
::
string
&
nfInstanceID
,
void
deregister_nf_instance
(
Pistache
::
Http
::
ResponseWriter
&
response
);
const
std
::
string
&
nfInstanceID
,
void
get_nf_instance
(
const
std
::
string
&
nfInstanceID
,
Pistache
::
Http
::
ResponseWriter
&
response
);
Pistache
::
Http
::
ResponseWriter
&
response
);
void
get_nf_instance
(
const
std
::
string
&
nfInstanceID
,
Pistache
::
Http
::
ResponseWriter
&
response
);
void
register_nf_instance
(
void
register_nf_instance
(
const
std
::
string
&
nfInstanceID
,
const
NFProfile
&
nFProfile
,
const
std
::
string
&
nfInstanceID
,
const
NFProfile
&
nFProfile
,
const
Pistache
::
Optional
<
Pistache
::
Http
::
Header
::
Raw
>
&
contentEncoding
,
const
Pistache
::
Optional
<
Pistache
::
Http
::
Header
::
Raw
>&
contentEncoding
,
Pistache
::
Http
::
ResponseWriter
&
response
);
Pistache
::
Http
::
ResponseWriter
&
response
);
void
update_nf_instance
(
const
std
::
string
&
nfInstanceID
,
void
update_nf_instance
(
const
std
::
vector
<
PatchItem
>
&
patchItem
,
const
std
::
string
&
nfInstanceID
,
const
std
::
vector
<
PatchItem
>&
patchItem
,
Pistache
::
Http
::
ResponseWriter
&
response
);
Pistache
::
Http
::
ResponseWriter
&
response
);
private:
private:
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
std
::
string
m_address
;
};
};
}
}
// namespace api
}
}
// namespace nrf
}
}
// namespace oai
#endif
#endif
src/api-server/impl/NFInstancesStoreApiImpl.cpp
View file @
b84d1cd8
...
@@ -23,13 +23,13 @@ using namespace oai::nrf::model;
...
@@ -23,13 +23,13 @@ using namespace oai::nrf::model;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
::
app
;
NFInstancesStoreApiImpl
::
NFInstancesStoreApiImpl
(
NFInstancesStoreApiImpl
::
NFInstancesStoreApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
std
::
string
address
)
:
NFInstancesStoreApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
m_address
(
address
)
{}
:
NFInstancesStoreApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
m_address
(
address
)
{}
void
NFInstancesStoreApiImpl
::
get_nf_instances
(
void
NFInstancesStoreApiImpl
::
get_nf_instances
(
const
Pistache
::
Optional
<
std
::
string
>
&
nfType
,
const
Pistache
::
Optional
<
std
::
string
>
&
nfType
,
const
Pistache
::
Optional
<
int32_t
>
&
limit
,
const
Pistache
::
Optional
<
int32_t
>
&
limit
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Logger
::
nrf_sbi
().
info
(
Logger
::
nrf_sbi
().
info
(
"Got a request to retrieve a collection of NF Instances"
);
"Got a request to retrieve a collection of NF Instances"
);
...
@@ -48,8 +48,8 @@ void NFInstancesStoreApiImpl::get_nf_instances(
...
@@ -48,8 +48,8 @@ void NFInstancesStoreApiImpl::get_nf_instances(
int
http_code
=
0
;
int
http_code
=
0
;
std
::
vector
<
std
::
string
>
uris
=
{};
std
::
vector
<
std
::
string
>
uris
=
{};
ProblemDetails
problem_details
=
{};
ProblemDetails
problem_details
=
{};
m_nrf_app
->
handle_get_nf_instances
(
nf_type
,
uris
,
limit_item
,
http_code
,
1
,
m_nrf_app
->
handle_get_nf_instances
(
problem_details
);
nf_type
,
uris
,
limit_item
,
http_code
,
1
,
problem_details
);
nlohmann
::
json
json_data
=
{};
nlohmann
::
json
json_data
=
{};
// TODO: std::string content_type = "application/3gppHal+json";
// TODO: std::string content_type = "application/3gppHal+json";
...
@@ -77,7 +77,7 @@ void NFInstancesStoreApiImpl::get_nf_instances(
...
@@ -77,7 +77,7 @@ void NFInstancesStoreApiImpl::get_nf_instances(
response
.
send
(
Pistache
::
Http
::
Code
(
http_code
),
json_data
.
dump
().
c_str
());
response
.
send
(
Pistache
::
Http
::
Code
(
http_code
),
json_data
.
dump
().
c_str
());
}
}
void
NFInstancesStoreApiImpl
::
options_nf_instances
(
void
NFInstancesStoreApiImpl
::
options_nf_instances
(
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Pistache
::
Http
::
ResponseWriter
&
response
)
{
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
"Do some magic
\n
"
);
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
"Do some magic
\n
"
);
}
}
...
...
src/api-server/impl/NFInstancesStoreApiImpl.h
View file @
b84d1cd8
/**
/**
* NRF NFDiscovery Service
* NRF NFDiscovery Service
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
*
* The version of the OpenAPI document: 1.1.0.alpha-1
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator
(https://openapi-generator.tech).
* NOTE: This class is auto generated by OpenAPI Generator
*
https://openapi-generator.tech
*
(https://openapi-generator.tech). https://openapi-generator.tech Do not edit
*
Do not edit
the class manually.
* the class manually.
*/
*/
/*
/*
...
@@ -58,22 +59,24 @@ using namespace oai::nrf::app;
...
@@ -58,22 +59,24 @@ using namespace oai::nrf::app;
class
NFInstancesStoreApiImpl
:
public
oai
::
nrf
::
api
::
NFInstancesStoreApi
{
class
NFInstancesStoreApiImpl
:
public
oai
::
nrf
::
api
::
NFInstancesStoreApi
{
public:
public:
NFInstancesStoreApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
NFInstancesStoreApiImpl
(
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
nrf_app
*
nrf_app_inst
,
~
NFInstancesStoreApiImpl
()
{
std
::
string
address
);
}
~
NFInstancesStoreApiImpl
()
{}
void
get_nf_instances
(
const
Pistache
::
Optional
<
std
::
string
>&
nfType
,
const
Pistache
::
Optional
<
int32_t
>&
limit
,
Pistache
::
Http
::
ResponseWriter
&
response
);
void
options_nf_instances
(
Pistache
::
Http
::
ResponseWriter
&
response
);
void
get_nf_instances
(
const
Pistache
::
Optional
<
std
::
string
>
&
nfType
,
const
Pistache
::
Optional
<
int32_t
>
&
limit
,
Pistache
::
Http
::
ResponseWriter
&
response
);
void
options_nf_instances
(
Pistache
::
Http
::
ResponseWriter
&
response
);
private:
private:
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
std
::
string
m_address
;
};
};
}
}
// namespace api
}
}
// namespace nrf
}
}
// namespace oai
#endif
#endif
src/api-server/impl/StoredSearchDocumentApiImpl.cpp
View file @
b84d1cd8
/**
/**
* NRF NFDiscovery Service
* NRF NFDiscovery Service
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
*
* The version of the OpenAPI document: 1.1.0.alpha-1
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator
(https://openapi-generator.tech).
* NOTE: This class is auto generated by OpenAPI Generator
*
https://openapi-generator.tech
*
(https://openapi-generator.tech). https://openapi-generator.tech Do not edit
*
Do not edit
the class manually.
* the class manually.
*/
*/
#include "StoredSearchDocumentApiImpl.h"
#include "StoredSearchDocumentApiImpl.h"
...
@@ -21,47 +22,44 @@ using namespace oai::nrf::model;
...
@@ -21,47 +22,44 @@ using namespace oai::nrf::model;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
::
app
;
StoredSearchDocumentApiImpl
::
StoredSearchDocumentApiImpl
(
StoredSearchDocumentApiImpl
::
StoredSearchDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
std
::
string
address
)
:
:
StoredSearchDocumentApi
(
rtr
),
StoredSearchDocumentApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
m_nrf_app
(
nrf_app_inst
),
m_address
(
address
)
{
m_address
(
address
)
{}
}
void
StoredSearchDocumentApiImpl
::
retrieve_stored_search
(
void
StoredSearchDocumentApiImpl
::
retrieve_stored_search
(
const
std
::
string
&
searchId
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
const
std
::
string
&
searchId
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Logger
::
nrf_sbi
().
info
(
Logger
::
nrf_sbi
().
info
(
"Got a request to retrieve a stored search with ID %s"
,
"Got a request to retrieve a stored search with ID %s"
,
searchId
.
c_str
());
searchId
.
c_str
());
nlohmann
::
json
sr_json
=
{
};
nlohmann
::
json
sr_json
=
{
};
nlohmann
::
json
json_data
=
{
};
nlohmann
::
json
json_data
=
{};
json_data
[
"nfInstances"
]
=
nlohmann
::
json
::
array
();
json_data
[
"nfInstances"
]
=
nlohmann
::
json
::
array
();
std
::
string
content_type
=
"application/json"
;
std
::
string
content_type
=
"application/json"
;
std
::
shared_ptr
<
nrf_search_result
>
search_result
=
{
};
std
::
shared_ptr
<
nrf_search_result
>
search_result
=
{};
m_nrf_app
->
find_search_result
(
searchId
,
search_result
);
m_nrf_app
->
find_search_result
(
searchId
,
search_result
);
// convert the profile to Json
// convert the profile to Json
if
(
search_result
!=
nullptr
)
{
if
(
search_result
!=
nullptr
)
{
search_result
.
get
()
->
to_json
(
sr_json
,
search_result
.
get
()
->
get_limit_nf_instances
());
search_result
.
get
()
->
to_json
(
sr_json
,
search_result
.
get
()
->
get_limit_nf_instances
());
json_data
[
"nfInstances"
]
=
sr_json
[
"nfInstances"
];
json_data
[
"nfInstances"
]
=
sr_json
[
"nfInstances"
];
}
}
Logger
::
nrf_sbi
().
debug
(
"Json data: %s"
,
json_data
.
dump
().
c_str
());
Logger
::
nrf_sbi
().
debug
(
"Json data: %s"
,
json_data
.
dump
().
c_str
());
// content type
// content type
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
ContentType
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
ContentType
>
(
>
(
Pistache
::
Http
::
Mime
::
MediaType
(
content_type
));
Pistache
::
Http
::
Mime
::
MediaType
(
content_type
));
//TODO: add headers: Cache-Control, ETag
// TODO: add headers: Cache-Control, ETag
response
.
send
(
Pistache
::
Http
::
Code
(
HTTP_STATUS_CODE_200_OK
),
json_data
.
dump
().
c_str
());
}
}
response
.
send
(
}
Pistache
::
Http
::
Code
(
HTTP_STATUS_CODE_200_OK
),
json_data
.
dump
().
c_str
());
}
}
}
// namespace api
}
// namespace nrf
}
// namespace oai
src/api-server/impl/StoredSearchDocumentApiImpl.h
View file @
b84d1cd8
/**
/**
* NRF NFDiscovery Service
* NRF NFDiscovery Service
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* NRF NFDiscovery Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
*
* The version of the OpenAPI document: 1.1.0.alpha-1
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator
(https://openapi-generator.tech).
* NOTE: This class is auto generated by OpenAPI Generator
*
https://openapi-generator.tech
*
(https://openapi-generator.tech). https://openapi-generator.tech Do not edit
*
Do not edit
the class manually.
* the class manually.
*/
*/
/*
/*
...
@@ -39,23 +40,24 @@ namespace api {
...
@@ -39,23 +40,24 @@ namespace api {
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
::
app
;
class
StoredSearchDocumentApiImpl
:
class
StoredSearchDocumentApiImpl
public
oai
::
nrf
::
api
::
StoredSearchDocumentApi
{
:
public
oai
::
nrf
::
api
::
StoredSearchDocumentApi
{
public:
public:
StoredSearchDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
StoredSearchDocumentApiImpl
(
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
nrf_app
*
nrf_app_inst
,
~
StoredSearchDocumentApiImpl
()
{
std
::
string
address
);
}
~
StoredSearchDocumentApiImpl
()
{}
void
retrieve_stored_search
(
const
std
::
string
&
searchId
,
Pistache
::
Http
::
ResponseWriter
&
response
);
void
retrieve_stored_search
(
const
std
::
string
&
searchId
,
Pistache
::
Http
::
ResponseWriter
&
response
);
private:
private:
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
std
::
string
m_address
;
};
};
}
}
// namespace api
}
}
// namespace nrf
}
}
// namespace oai
#endif
#endif
src/api-server/impl/SubscriptionIDDocumentApiImpl.cpp
View file @
b84d1cd8
...
@@ -22,23 +22,23 @@ using namespace oai::nrf::model;
...
@@ -22,23 +22,23 @@ using namespace oai::nrf::model;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
::
app
;
SubscriptionIDDocumentApiImpl
::
SubscriptionIDDocumentApiImpl
(
SubscriptionIDDocumentApiImpl
::
SubscriptionIDDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
std
::
string
address
)
:
SubscriptionIDDocumentApi
(
rtr
),
:
SubscriptionIDDocumentApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
m_nrf_app
(
nrf_app_inst
),
m_address
(
address
)
{}
m_address
(
address
)
{}
void
SubscriptionIDDocumentApiImpl
::
remove_subscription
(
void
SubscriptionIDDocumentApiImpl
::
remove_subscription
(
const
std
::
string
&
subscriptionID
,
const
std
::
string
&
subscriptionID
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Logger
::
nrf_sbi
().
info
(
Logger
::
nrf_sbi
().
info
(
"Got a request to remove an existing subscription, subscription ID %s"
,
"Got a request to remove an existing subscription, subscription ID %s"
,
subscriptionID
.
c_str
());
subscriptionID
.
c_str
());
int
http_code
=
0
;
int
http_code
=
0
;
ProblemDetails
problem_details
=
{};
ProblemDetails
problem_details
=
{};
m_nrf_app
->
handle_remove_subscription
(
subscriptionID
,
http_code
,
1
,
m_nrf_app
->
handle_remove_subscription
(
problem_details
);
subscriptionID
,
http_code
,
1
,
problem_details
);
nlohmann
::
json
json_data
=
{};
nlohmann
::
json
json_data
=
{};
std
::
string
content_type
=
"application/json"
;
std
::
string
content_type
=
"application/json"
;
...
@@ -58,8 +58,8 @@ void SubscriptionIDDocumentApiImpl::remove_subscription(
...
@@ -58,8 +58,8 @@ void SubscriptionIDDocumentApiImpl::remove_subscription(
}
}
}
}
void
SubscriptionIDDocumentApiImpl
::
update_subscription
(
void
SubscriptionIDDocumentApiImpl
::
update_subscription
(
const
std
::
string
&
subscriptionID
,
const
std
::
vector
<
PatchItem
>
&
patchItem
,
const
std
::
string
&
subscriptionID
,
const
std
::
vector
<
PatchItem
>&
patchItem
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Logger
::
nrf_sbi
().
info
(
Logger
::
nrf_sbi
().
info
(
"Got a request to update of subscription to NF instances, subscription "
"Got a request to update of subscription to NF instances, subscription "
"ID %s"
,
"ID %s"
,
...
@@ -67,8 +67,8 @@ void SubscriptionIDDocumentApiImpl::update_subscription(
...
@@ -67,8 +67,8 @@ void SubscriptionIDDocumentApiImpl::update_subscription(
int
http_code
=
0
;
int
http_code
=
0
;
ProblemDetails
problem_details
=
{};
ProblemDetails
problem_details
=
{};
m_nrf_app
->
handle_update_subscription
(
subscriptionID
,
patchItem
,
http_code
,
1
,
m_nrf_app
->
handle_update_subscription
(
problem_details
);
subscriptionID
,
patchItem
,
http_code
,
1
,
problem_details
);
// TODO: (section 5.2.2.5.6, Update of Subscription to NF Instances,
// TODO: (section 5.2.2.5.6, Update of Subscription to NF Instances,
// 3GPP TS 29.510 V16.0.0 (2019-06)) if the NRF accepts the extension
// 3GPP TS 29.510 V16.0.0 (2019-06)) if the NRF accepts the extension
...
...
src/api-server/impl/SubscriptionIDDocumentApiImpl.h
View file @
b84d1cd8
/**
/**
* NRF NFManagement Service
* NRF NFManagement Service
* NRF NFManagement Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* NRF NFManagement Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
*
* The version of the OpenAPI document: 1.1.0.alpha-1
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator
(https://openapi-generator.tech).
* NOTE: This class is auto generated by OpenAPI Generator
*
https://openapi-generator.tech
*
(https://openapi-generator.tech). https://openapi-generator.tech Do not edit
*
Do not edit
the class manually.
* the class manually.
*/
*/
/*
/*
...
@@ -42,26 +43,29 @@ namespace api {
...
@@ -42,26 +43,29 @@ namespace api {
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
::
app
;
class
SubscriptionIDDocumentApiImpl
:
class
SubscriptionIDDocumentApiImpl
public
oai
::
nrf
::
api
::
SubscriptionIDDocumentApi
{
:
public
oai
::
nrf
::
api
::
SubscriptionIDDocumentApi
{
public:
public:
SubscriptionIDDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
SubscriptionIDDocumentApiImpl
(
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
nrf_app
*
nrf_app_inst
,
~
SubscriptionIDDocumentApiImpl
()
{
std
::
string
address
);
}
~
SubscriptionIDDocumentApiImpl
()
{}
void
remove_subscription
(
const
std
::
string
&
subscriptionID
,
Pistache
::
Http
::
ResponseWriter
&
response
);
void
update_subscription
(
const
std
::
string
&
subscriptionID
,
const
std
::
vector
<
PatchItem
>&
patchItem
,
Pistache
::
Http
::
ResponseWriter
&
response
);
void
remove_subscription
(
const
std
::
string
&
subscriptionID
,
Pistache
::
Http
::
ResponseWriter
&
response
);
void
update_subscription
(
const
std
::
string
&
subscriptionID
,
const
std
::
vector
<
PatchItem
>
&
patchItem
,
Pistache
::
Http
::
ResponseWriter
&
response
);
private:
private:
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
std
::
string
m_address
;
};
};
}
}
// namespace api
}
}
// namespace nrf
}
}
// namespace oai
#endif
#endif
src/api-server/impl/SubscriptionsCollectionApiImpl.cpp
View file @
b84d1cd8
...
@@ -28,15 +28,15 @@ using namespace oai::nrf::model;
...
@@ -28,15 +28,15 @@ using namespace oai::nrf::model;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
::
app
;
SubscriptionsCollectionApiImpl
::
SubscriptionsCollectionApiImpl
(
SubscriptionsCollectionApiImpl
::
SubscriptionsCollectionApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
std
::
string
address
)
:
SubscriptionsCollectionApi
(
rtr
),
:
SubscriptionsCollectionApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
m_nrf_app
(
nrf_app_inst
),
m_address
(
address
)
{}
m_address
(
address
)
{}
void
SubscriptionsCollectionApiImpl
::
create_subscription
(
void
SubscriptionsCollectionApiImpl
::
create_subscription
(
const
SubscriptionData
&
subscriptionData
,
const
SubscriptionData
&
subscriptionData
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Logger
::
nrf_sbi
().
info
(
"Got a request to create a new subscription"
);
Logger
::
nrf_sbi
().
info
(
"Got a request to create a new subscription"
);
int
http_code
=
0
;
int
http_code
=
0
;
...
@@ -46,8 +46,8 @@ void SubscriptionsCollectionApiImpl::create_subscription(
...
@@ -46,8 +46,8 @@ void SubscriptionsCollectionApiImpl::create_subscription(
to_json
(
json_sub
,
subscriptionData
);
to_json
(
json_sub
,
subscriptionData
);
Logger
::
nrf_sbi
().
debug
(
"Subscription data %s"
,
json_sub
.
dump
().
c_str
());
Logger
::
nrf_sbi
().
debug
(
"Subscription data %s"
,
json_sub
.
dump
().
c_str
());
m_nrf_app
->
handle_create_subscription
(
subscriptionData
,
sub_id
,
http_code
,
1
,
m_nrf_app
->
handle_create_subscription
(
problem_details
);
subscriptionData
,
sub_id
,
http_code
,
1
,
problem_details
);
nlohmann
::
json
json_data
=
{};
nlohmann
::
json
json_data
=
{};
std
::
string
content_type
=
"application/json"
;
std
::
string
content_type
=
"application/json"
;
...
...
src/api-server/impl/SubscriptionsCollectionApiImpl.h
View file @
b84d1cd8
/**
/**
* NRF NFManagement Service
* NRF NFManagement Service
* NRF NFManagement Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
* NRF NFManagement Service. © 2019, 3GPP Organizational Partners (ARIB, ATIS,
* CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
*
* The version of the OpenAPI document: 1.1.0.alpha-1
* The version of the OpenAPI document: 1.1.0.alpha-1
*
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator
(https://openapi-generator.tech).
* NOTE: This class is auto generated by OpenAPI Generator
*
https://openapi-generator.tech
*
(https://openapi-generator.tech). https://openapi-generator.tech Do not edit
*
Do not edit
the class manually.
* the class manually.
*/
*/
/*
/*
...
@@ -39,23 +40,25 @@ namespace api {
...
@@ -39,23 +40,25 @@ namespace api {
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
::
app
;
class
SubscriptionsCollectionApiImpl
:
class
SubscriptionsCollectionApiImpl
public
oai
::
nrf
::
api
::
SubscriptionsCollectionApi
{
:
public
oai
::
nrf
::
api
::
SubscriptionsCollectionApi
{
public:
public:
SubscriptionsCollectionApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
SubscriptionsCollectionApiImpl
(
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
nrf_app
*
nrf_app_inst
,
~
SubscriptionsCollectionApiImpl
()
{
std
::
string
address
);
}
~
SubscriptionsCollectionApiImpl
()
{}
void
create_subscription
(
const
SubscriptionData
&
subscriptionData
,
Pistache
::
Http
::
ResponseWriter
&
response
);
void
create_subscription
(
const
SubscriptionData
&
subscriptionData
,
Pistache
::
Http
::
ResponseWriter
&
response
);
private:
private:
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
std
::
string
m_address
;
};
};
}
}
// namespace api
}
}
// namespace nrf
}
}
// namespace oai
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment