6 This is the initial REST API for RIC subscription # noqa: E501
8 OpenAPI spec version: 0.0.4
10 Generated by: https://github.com/swagger-api/swagger-codegen.git
14 from __future__ import absolute_import
16 import re # noqa: F401
18 # python 2 and python 3 compatibility library
21 from ricxappframe.subsclient.api_client import ApiClient
24 class CommonApi(object):
25 """NOTE: This class is auto generated by the swagger code generator program.
27 Do not edit the class manually.
28 Ref: https://github.com/swagger-api/swagger-codegen
31 def __init__(self, api_client=None):
32 if api_client is None:
33 api_client = ApiClient()
34 self.api_client = api_client
36 def get_all_subscriptions(self, **kwargs): # noqa: E501
37 """Returns list of subscriptions # noqa: E501
39 This method makes a synchronous HTTP request by default. To make an
40 asynchronous HTTP request, please pass async_req=True
41 >>> thread = api.get_all_subscriptions(async_req=True)
42 >>> result = thread.get()
45 :return: SubscriptionList
46 If the method is called asynchronously,
47 returns the request thread.
49 kwargs['_return_http_data_only'] = True
50 if kwargs.get('async_req'):
51 return self.get_all_subscriptions_with_http_info(**kwargs) # noqa: E501
53 (data) = self.get_all_subscriptions_with_http_info(**kwargs) # noqa: E501
56 def get_all_subscriptions_with_http_info(self, **kwargs): # noqa: E501
57 """Returns list of subscriptions # noqa: E501
59 This method makes a synchronous HTTP request by default. To make an
60 asynchronous HTTP request, please pass async_req=True
61 >>> thread = api.get_all_subscriptions_with_http_info(async_req=True)
62 >>> result = thread.get()
65 :return: SubscriptionList
66 If the method is called asynchronously,
67 returns the request thread.
70 all_params = [] # noqa: E501
71 all_params.append('async_req')
72 all_params.append('_return_http_data_only')
73 all_params.append('_preload_content')
74 all_params.append('_request_timeout')
77 for key, val in six.iteritems(params['kwargs']):
78 if key not in all_params:
80 "Got an unexpected keyword argument '%s'"
81 " to method get_all_subscriptions" % key
86 collection_formats = {}
98 # HTTP header `Accept`
99 header_params['Accept'] = self.api_client.select_header_accept(
100 ['application/json']) # noqa: E501
102 # Authentication setting
103 auth_settings = [] # noqa: E501
105 return self.api_client.call_api(
106 '/subscriptions', 'GET',
111 post_params=form_params,
112 files=local_var_files,
113 response_type='SubscriptionList', # noqa: E501
114 auth_settings=auth_settings,
115 async_req=params.get('async_req'),
116 _return_http_data_only=params.get('_return_http_data_only'),
117 _preload_content=params.get('_preload_content', True),
118 _request_timeout=params.get('_request_timeout'),
119 collection_formats=collection_formats)
121 def subscribe(self, **kwargs): # noqa: E501
122 """Subscribe a list of X2AP event triggers to receive messages sent by RAN # noqa: E501
124 This method makes a synchronous HTTP request by default. To make an
125 asynchronous HTTP request, please pass async_req=True
126 >>> thread = api.subscribe(async_req=True)
127 >>> result = thread.get()
129 :param async_req bool
130 :param SubscriptionParams subscription_params: Subscription parameters
131 :return: SubscriptionResponse
132 If the method is called asynchronously,
133 returns the request thread.
135 kwargs['_return_http_data_only'] = True
136 if kwargs.get('async_req'):
137 return self.subscribe_with_http_info(**kwargs) # noqa: E501
139 (data) = self.subscribe_with_http_info(**kwargs) # noqa: E501
142 def subscribe_with_http_info(self, **kwargs): # noqa: E501
143 """Subscribe a list of X2AP event triggers to receive messages sent by RAN # noqa: E501
145 This method makes a synchronous HTTP request by default. To make an
146 asynchronous HTTP request, please pass async_req=True
147 >>> thread = api.subscribe_with_http_info(async_req=True)
148 >>> result = thread.get()
150 :param async_req bool
151 :param SubscriptionParams subscription_params: Subscription parameters
152 :return: SubscriptionResponse
153 If the method is called asynchronously,
154 returns the request thread.
157 all_params = ['subscription_params'] # noqa: E501
158 all_params.append('async_req')
159 all_params.append('_return_http_data_only')
160 all_params.append('_preload_content')
161 all_params.append('_request_timeout')
164 for key, val in six.iteritems(params['kwargs']):
165 if key not in all_params:
167 "Got an unexpected keyword argument '%s'"
168 " to method subscribe" % key
173 collection_formats = {}
185 if 'subscription_params' in params:
186 body_params = params['subscription_params']
187 # HTTP header `Accept`
188 header_params['Accept'] = self.api_client.select_header_accept(
189 ['application/json']) # noqa: E501
191 # HTTP header `Content-Type`
192 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
193 ['application/json']) # noqa: E501
195 # Authentication setting
196 auth_settings = [] # noqa: E501
198 return self.api_client.call_api(
199 '/subscriptions', 'POST',
204 post_params=form_params,
205 files=local_var_files,
206 response_type='SubscriptionResponse', # noqa: E501
207 auth_settings=auth_settings,
208 async_req=params.get('async_req'),
209 _return_http_data_only=params.get('_return_http_data_only'),
210 _preload_content=params.get('_preload_content', True),
211 _request_timeout=params.get('_request_timeout'),
212 collection_formats=collection_formats)
214 def unsubscribe(self, subscription_id, **kwargs): # noqa: E501
215 """Unsubscribe X2AP events from Subscription Manager # noqa: E501
217 This method makes a synchronous HTTP request by default. To make an
218 asynchronous HTTP request, please pass async_req=True
219 >>> thread = api.unsubscribe(subscription_id, async_req=True)
220 >>> result = thread.get()
222 :param async_req bool
223 :param str subscription_id: The subscriptionId received in the Subscription Response (required)
225 If the method is called asynchronously,
226 returns the request thread.
228 kwargs['_return_http_data_only'] = True
229 if kwargs.get('async_req'):
230 return self.unsubscribe_with_http_info(subscription_id, **kwargs) # noqa: E501
232 (data) = self.unsubscribe_with_http_info(subscription_id, **kwargs) # noqa: E501
235 def unsubscribe_with_http_info(self, subscription_id, **kwargs): # noqa: E501
236 """Unsubscribe X2AP events from Subscription Manager # noqa: E501
238 This method makes a synchronous HTTP request by default. To make an
239 asynchronous HTTP request, please pass async_req=True
240 >>> thread = api.unsubscribe_with_http_info(subscription_id, async_req=True)
241 >>> result = thread.get()
243 :param async_req bool
244 :param str subscription_id: The subscriptionId received in the Subscription Response (required)
246 If the method is called asynchronously,
247 returns the request thread.
250 all_params = ['subscription_id'] # noqa: E501
251 all_params.append('async_req')
252 all_params.append('_return_http_data_only')
253 all_params.append('_preload_content')
254 all_params.append('_request_timeout')
257 for key, val in six.iteritems(params['kwargs']):
258 if key not in all_params:
260 "Got an unexpected keyword argument '%s'"
261 " to method unsubscribe" % key
265 # verify the required parameter 'subscription_id' is set
266 if self.api_client.client_side_validation and ('subscription_id' not in params or
267 params['subscription_id'] is None): # noqa: E501
268 raise ValueError("Missing the required parameter `subscription_id` when calling `unsubscribe`") # noqa: E501
270 collection_formats = {}
273 if 'subscription_id' in params:
274 path_params['subscriptionId'] = params['subscription_id'] # noqa: E501
284 # HTTP header `Accept`
285 header_params['Accept'] = self.api_client.select_header_accept(
286 ['application/json']) # noqa: E501
288 # HTTP header `Content-Type`
289 header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
290 ['application/json']) # noqa: E501
292 # Authentication setting
293 auth_settings = [] # noqa: E501
295 return self.api_client.call_api(
296 '/subscriptions/{subscriptionId}', 'DELETE',
301 post_params=form_params,
302 files=local_var_files,
303 response_type=None, # noqa: E501
304 auth_settings=auth_settings,
305 async_req=params.get('async_req'),
306 _return_http_data_only=params.get('_return_http_data_only'),
307 _preload_content=params.get('_preload_content', True),
308 _request_timeout=params.get('_request_timeout'),
309 collection_formats=collection_formats)