Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
cn5g
oai-cn5g-nrf
Commits
5c5a381f
Commit
5c5a381f
authored
Dec 10, 2020
by
Tien-Thinh Nguyen
Browse files
add RegisterNFInstance and NFInstances operations
parent
08e76121
Changes
37
Hide whitespace changes
Inline
Side-by-side
src/api-server/api/CompleteStoredSearchDocumentApi.cpp
View file @
5c5a381f
...
...
@@ -14,7 +14,7 @@
#include "Helpers.h"
#include "nrf_config.hpp"
extern
oai
::
nrf
::
nrf_config
nrf_cfg
;
extern
oai
::
nrf
::
app
::
nrf_config
nrf_cfg
;
namespace
oai
{
namespace
nrf
{
...
...
src/api-server/api/DiscNFInstancesStoreApi.cpp
View file @
5c5a381f
...
...
@@ -15,7 +15,7 @@
#include "nrf_config.hpp"
#include "logger.hpp"
extern
oai
::
nrf
::
nrf_config
nrf_cfg
;
extern
oai
::
nrf
::
app
::
nrf_config
nrf_cfg
;
namespace
oai
{
namespace
nrf
{
...
...
src/api-server/api/NFInstanceIDDocumentApi.cpp
View file @
5c5a381f
...
...
@@ -15,7 +15,7 @@
#include "nrf_config.hpp"
#include "logger.hpp"
extern
oai
::
nrf
::
nrf_config
nrf_cfg
;
extern
oai
::
nrf
::
app
::
nrf_config
nrf_cfg
;
namespace
oai
{
namespace
nrf
{
...
...
src/api-server/api/NFInstancesStoreApi.cpp
View file @
5c5a381f
...
...
@@ -15,13 +15,13 @@
#include "nrf_config.hpp"
#include "logger.hpp"
extern
oai
::
nrf
::
nrf_config
nrf_cfg
;
extern
oai
::
nrf
::
app
::
nrf_config
nrf_cfg
;
namespace
oai
{
namespace
nrf
{
namespace
api
{
using
namespace
oai
::
nrf
;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
::
model
;
NFInstancesStoreApi
::
NFInstancesStoreApi
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
)
{
...
...
src/api-server/api/NFInstancesStoreApi.h
View file @
5c5a381f
...
...
@@ -57,7 +57,7 @@ public:
virtual
~
NFInstancesStoreApi
()
{}
void
init
();
const
std
::
string
base
=
"/nnrf-nfm/
v1
"
;
const
std
::
string
base
=
"/nnrf-nfm/"
;
private:
void
setupRoutes
();
...
...
src/api-server/api/StoredSearchDocumentApi.cpp
View file @
5c5a381f
...
...
@@ -14,7 +14,7 @@
#include "Helpers.h"
#include "nrf_config.hpp"
extern
oai
::
nrf
::
nrf_config
nrf_cfg
;
extern
oai
::
nrf
::
app
::
nrf_config
nrf_cfg
;
namespace
oai
{
namespace
nrf
{
...
...
src/api-server/api/SubscriptionIDDocumentApi.cpp
View file @
5c5a381f
...
...
@@ -14,7 +14,7 @@
#include "Helpers.h"
#include "nrf_config.hpp"
extern
oai
::
nrf
::
nrf_config
nrf_cfg
;
extern
oai
::
nrf
::
app
::
nrf_config
nrf_cfg
;
namespace
oai
{
namespace
nrf
{
...
...
src/api-server/api/SubscriptionsCollectionApi.cpp
View file @
5c5a381f
...
...
@@ -14,7 +14,7 @@
#include "Helpers.h"
#include "nrf_config.hpp"
extern
oai
::
nrf
::
nrf_config
nrf_cfg
;
extern
oai
::
nrf
::
app
::
nrf_config
nrf_cfg
;
namespace
oai
{
namespace
nrf
{
...
...
src/api-server/impl/CompleteStoredSearchDocumentApiImpl.cpp
View file @
5c5a381f
...
...
@@ -17,9 +17,10 @@ namespace nrf {
namespace
api
{
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
CompleteStoredSearchDocumentApiImpl
::
CompleteStoredSearchDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf
::
nrf_app
*
nrf_app_inst
,
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
:
CompleteStoredSearchDocumentApi
(
rtr
),
...
...
src/api-server/impl/CompleteStoredSearchDocumentApiImpl.h
View file @
5c5a381f
...
...
@@ -37,12 +37,13 @@ namespace nrf {
namespace
api
{
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
class
CompleteStoredSearchDocumentApiImpl
:
public
oai
::
nrf
::
api
::
CompleteStoredSearchDocumentApi
{
public:
CompleteStoredSearchDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
oai
::
nrf
::
nrf_app
*
nrf_app_inst
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
~
CompleteStoredSearchDocumentApiImpl
()
{
}
...
...
@@ -50,7 +51,7 @@ class CompleteStoredSearchDocumentApiImpl :
void
retrieve_complete_search
(
const
std
::
string
&
searchId
,
Pistache
::
Http
::
ResponseWriter
&
response
);
private:
oai
::
nrf
::
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
};
...
...
src/api-server/impl/DiscNFInstancesStoreApiImpl.cpp
View file @
5c5a381f
...
...
@@ -18,10 +18,11 @@ namespace nrf {
namespace
api
{
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
DiscNFInstancesStoreApiImpl
::
DiscNFInstancesStoreApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
oai
::
nrf
::
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
:
DiscNFInstancesStoreApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
...
...
src/api-server/impl/DiscNFInstancesStoreApiImpl.h
View file @
5c5a381f
...
...
@@ -54,11 +54,12 @@ namespace nrf {
namespace
api
{
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
class
DiscNFInstancesStoreApiImpl
:
public
oai
::
nrf
::
api
::
DiscNFInstancesStoreApi
{
public:
DiscNFInstancesStoreApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
oai
::
nrf
::
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
~
DiscNFInstancesStoreApiImpl
()
{
}
...
...
@@ -112,7 +113,7 @@ class DiscNFInstancesStoreApiImpl : public oai::nrf::api::DiscNFInstancesStoreAp
const
Pistache
::
Optional
<
Pistache
::
Http
::
Header
::
Raw
>
&
ifNoneMatch
,
Pistache
::
Http
::
ResponseWriter
&
response
);
private:
oai
::
nrf
::
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
};
...
...
src/api-server/impl/NFInstanceIDDocumentApiImpl.cpp
View file @
5c5a381f
...
...
@@ -19,9 +19,11 @@ namespace nrf {
namespace
api
{
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
using
namespace
oai
::
nrf
;
NFInstanceIDDocumentApiImpl
::
NFInstanceIDDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
oai
::
nrf
::
nrf_app
*
nrf_app_inst
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
:
NFInstanceIDDocumentApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
m_address
(
address
)
...
...
@@ -38,7 +40,7 @@ void NFInstanceIDDocumentApiImpl::register_nf_instance(const std::string &nfInst
NFProfile
nf_profile
=
nFProfile
;
int
http_code
=
0
;
m_nrf_app
->
handle_nf_instance_registration_request
(
nfInstanceID
,
n
f_p
rofile
,
http_code
,
1
);
m_nrf_app
->
handle_nf_instance_registration_request
(
nfInstanceID
,
n
FP
rofile
,
http_code
,
1
);
nlohmann
::
json
json_data
=
{
};
to_json
(
json_data
,
nf_profile
);
...
...
src/api-server/impl/NFInstanceIDDocumentApiImpl.h
View file @
5c5a381f
...
...
@@ -41,11 +41,12 @@ namespace nrf {
namespace
api
{
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
class
NFInstanceIDDocumentApiImpl
:
public
oai
::
nrf
::
api
::
NFInstanceIDDocumentApi
{
public:
NFInstanceIDDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
oai
::
nrf
::
nrf_app
*
nrf_app_inst
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
~
NFInstanceIDDocumentApiImpl
()
{}
...
...
@@ -54,7 +55,7 @@ public:
void
register_nf_instance
(
const
std
::
string
&
nfInstanceID
,
const
NFProfile
&
nFProfile
,
const
Pistache
::
Optional
<
Pistache
::
Http
::
Header
::
Raw
>
&
contentEncoding
,
Pistache
::
Http
::
ResponseWriter
&
response
);
void
update_nf_instance
(
const
std
::
string
&
nfInstanceID
,
const
std
::
vector
<
PatchItem
>
&
patchItem
,
Pistache
::
Http
::
ResponseWriter
&
response
);
private:
oai
::
nrf
::
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
};
...
...
src/api-server/impl/NFInstancesStoreApiImpl.cpp
View file @
5c5a381f
/**
* NRF NFManagement Service
* 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
* NRF NFManagement Service
* 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "NFInstancesStoreApiImpl.h"
#include "logger.hpp"
#include "nrf_app.hpp"
namespace
oai
{
namespace
nrf
{
namespace
api
{
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
NFInstancesStoreApiImpl
::
NFInstancesStoreApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
oai
::
nrf
::
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
:
NFInstancesStoreApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
m_address
(
address
)
{
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
:
NFInstancesStoreApi
(
rtr
),
m_nrf_app
(
nrf_app_inst
),
m_address
(
address
)
{
}
void
NFInstancesStoreApiImpl
::
get_nf_instances
(
const
Pistache
::
Optional
<
std
::
string
>
&
nfType
,
const
Pistache
::
Optional
<
int32_t
>
&
limit
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
"Do some magic
\n
"
);
void
NFInstancesStoreApiImpl
::
get_nf_instances
(
const
Pistache
::
Optional
<
std
::
string
>
&
nfType
,
const
Pistache
::
Optional
<
int32_t
>
&
limit
,
Pistache
::
Http
::
ResponseWriter
&
response
)
{
Logger
::
nrf_sbi
().
info
(
"Got a request to retrieve a collection of NF Instances"
);
std
::
string
nf_type
=
{
};
if
(
!
nfType
.
isEmpty
())
{
nf_type
=
nfType
.
get
();
Logger
::
nrf_sbi
().
debug
(
"Retrieve a collection of NF Instances, NF type: %s"
,
nf_type
.
c_str
());
}
uint32_t
limit_item
=
0
;
if
(
!
limit
.
isEmpty
())
{
limit_item
=
limit
.
get
();
Logger
::
nrf_sbi
().
debug
(
"Retrieve a collection of NF Instances, limit number of items: %d"
,
limit_item
);
}
int
http_code
=
0
;
m_nrf_app
->
handle_get_nf_instances
(
nf_type
,
limit_item
,
http_code
,
1
);
nlohmann
::
json
json_data
=
{
};
//to_json(json_data, nf_profile);
//response.send(Pistache::Http::Code::Ok, json_data.dump().c_str());
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
"Do some magic
\n
"
);
}
void
NFInstancesStoreApiImpl
::
options_nf_instances
(
Pistache
::
Http
::
ResponseWriter
&
response
)
{
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
"Do some magic
\n
"
);
void
NFInstancesStoreApiImpl
::
options_nf_instances
(
Pistache
::
Http
::
ResponseWriter
&
response
)
{
response
.
send
(
Pistache
::
Http
::
Code
::
Ok
,
"Do some magic
\n
"
);
}
}
...
...
src/api-server/impl/NFInstancesStoreApiImpl.h
View file @
5c5a381f
...
...
@@ -56,18 +56,19 @@ namespace nrf {
namespace
api
{
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
class
NFInstancesStoreApiImpl
:
public
oai
::
nrf
::
api
::
NFInstancesStoreApi
{
public:
NFInstancesStoreApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
oai
::
nrf
::
nrf_app
*
nrf_app_inst
,
nrf_app
*
nrf_app_inst
,
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
);
private:
oai
::
nrf
::
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
};
...
...
src/api-server/impl/StoredSearchDocumentApiImpl.cpp
View file @
5c5a381f
...
...
@@ -17,9 +17,10 @@ namespace nrf {
namespace
api
{
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
StoredSearchDocumentApiImpl
::
StoredSearchDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
oai
::
nrf
::
nrf_app
*
nrf_app_inst
,
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
:
StoredSearchDocumentApi
(
rtr
),
...
...
src/api-server/impl/StoredSearchDocumentApiImpl.h
View file @
5c5a381f
...
...
@@ -38,17 +38,18 @@ namespace nrf {
namespace
api
{
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
class
StoredSearchDocumentApiImpl
:
public
oai
::
nrf
::
api
::
StoredSearchDocumentApi
{
public:
StoredSearchDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
oai
::
nrf
::
nrf_app
*
nrf_app_inst
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
);
~
StoredSearchDocumentApiImpl
()
{}
void
retrieve_stored_search
(
const
std
::
string
&
searchId
,
Pistache
::
Http
::
ResponseWriter
&
response
);
private:
oai
::
nrf
::
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
};
...
...
src/api-server/impl/SubscriptionIDDocumentApiImpl.cpp
View file @
5c5a381f
...
...
@@ -17,9 +17,10 @@ namespace nrf {
namespace
api
{
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
SubscriptionIDDocumentApiImpl
::
SubscriptionIDDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
oai
::
nrf
::
nrf_app
*
nrf_app_inst
,
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
rtr
,
nrf_app
*
nrf_app_inst
,
std
::
string
address
)
:
SubscriptionIDDocumentApi
(
rtr
),
...
...
src/api-server/impl/SubscriptionIDDocumentApiImpl.h
View file @
5c5a381f
...
...
@@ -41,18 +41,19 @@ namespace nrf {
namespace
api
{
using
namespace
oai
::
nrf
::
model
;
using
namespace
oai
::
nrf
::
app
;
class
SubscriptionIDDocumentApiImpl
:
public
oai
::
nrf
::
api
::
SubscriptionIDDocumentApi
{
public:
SubscriptionIDDocumentApiImpl
(
std
::
shared_ptr
<
Pistache
::
Rest
::
Router
>
,
oai
::
nrf
::
nrf_app
*
nrf_app_inst
,
nrf_app
*
nrf_app_inst
,
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
);
private:
oai
::
nrf
::
nrf_app
*
m_nrf_app
;
nrf_app
*
m_nrf_app
;
std
::
string
m_address
;
};
...
...
Prev
1
2
Next
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