• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atlanticwave-sdx / sdx-lc-client / 3715129759

pending completion
3715129759

push

github

GitHub
Merge pull request #2 from atlanticwave-sdx/1.add-github-actions

106 of 562 new or added lines in 18 files covered. (18.86%)

1173 of 2405 relevant lines covered (48.77%)

1.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

34.07
/swagger_client/api/node_api.py
1
# coding: utf-8
2

3
"""
3✔
4
    SDX LC
5

6
    You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).   # noqa: E501
7

8
    OpenAPI spec version: 1.0.0
9
    Contact: yxin@renci.org
10
    Generated by: https://github.com/swagger-api/swagger-codegen.git
11
"""
12

13
from __future__ import absolute_import
3✔
14

15
import re  # noqa: F401
3✔
16

17
# python 2 and python 3 compatibility library
18
import six
3✔
19

20
from swagger_client.api_client import ApiClient
3✔
21

22

23
class NodeApi(object):
3✔
24
    """NOTE: This class is auto generated by the swagger code generator program.
25

26
    Do not edit the class manually.
27
    Ref: https://github.com/swagger-api/swagger-codegen
28
    """
29

30
    def __init__(self, api_client=None):
3✔
31
        if api_client is None:
3✔
32
            api_client = ApiClient()
3✔
33
        self.api_client = api_client
3✔
34

35
    def add_node(self, body, **kwargs):  # noqa: E501
3✔
36
        """add a new node to the topology  # noqa: E501
37

38
        This method makes a synchronous HTTP request by default. To make an
39
        asynchronous HTTP request, please pass async_req=True
40
        >>> thread = api.add_node(body, async_req=True)
41
        >>> result = thread.get()
42

43
        :param async_req bool
44
        :param Node body: node object that needs to be sent to the SDX LC (required)
45
        :return: Node
46
                 If the method is called asynchronously,
47
                 returns the request thread.
48
        """
49
        kwargs["_return_http_data_only"] = True
3✔
50
        if kwargs.get("async_req"):
3✔
51
            return self.add_node_with_http_info(body, **kwargs)  # noqa: E501
×
52
        else:
53
            (data) = self.add_node_with_http_info(body, **kwargs)  # noqa: E501
3✔
54
            return data
3✔
55

56
    def add_node_with_http_info(self, body, **kwargs):  # noqa: E501
3✔
57
        """add a new node to the topology  # noqa: E501
58

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.add_node_with_http_info(body, async_req=True)
62
        >>> result = thread.get()
63

64
        :param async_req bool
65
        :param Node body: node object that needs to be sent to the SDX LC (required)
66
        :return: Node
67
                 If the method is called asynchronously,
68
                 returns the request thread.
69
        """
70

71
        all_params = ["body"]  # noqa: E501
3✔
72
        all_params.append("async_req")
3✔
73
        all_params.append("_return_http_data_only")
3✔
74
        all_params.append("_preload_content")
3✔
75
        all_params.append("_request_timeout")
3✔
76

77
        params = locals()
3✔
78
        for key, val in six.iteritems(params["kwargs"]):
3✔
79
            if key not in all_params:
3✔
80
                raise TypeError(
×
81
                    "Got an unexpected keyword argument '%s'"
82
                    " to method add_node" % key
83
                )
84
            params[key] = val
3✔
85
        del params["kwargs"]
3✔
86
        # verify the required parameter 'body' is set
87
        if "body" not in params or params["body"] is None:
3✔
NEW
88
            raise ValueError(
×
89
                "Missing the required parameter `body` when calling `add_node`"
90
            )  # noqa: E501
91

92
        collection_formats = {}
3✔
93

94
        path_params = {}
3✔
95

96
        query_params = []
3✔
97

98
        header_params = {}
3✔
99

100
        form_params = []
3✔
101
        local_var_files = {}
3✔
102

103
        body_params = None
3✔
104
        if "body" in params:
3✔
105
            body_params = params["body"]
3✔
106
        # HTTP header `Accept`
107
        header_params["Accept"] = self.api_client.select_header_accept(
3✔
108
            ["application/json", "text/plain"]
109
        )  # noqa: E501
110

111
        # HTTP header `Content-Type`
112
        header_params[
3✔
113
            "Content-Type"
114
        ] = self.api_client.select_header_content_type(  # noqa: E501
115
            ["application/json"]
116
        )  # noqa: E501
117

118
        # Authentication setting
119
        auth_settings = []  # noqa: E501
3✔
120

121
        return self.api_client.call_api(
3✔
122
            "/node",
123
            "POST",
124
            path_params,
125
            query_params,
126
            header_params,
127
            body=body_params,
128
            post_params=form_params,
129
            files=local_var_files,
130
            response_type="Node",  # noqa: E501
131
            auth_settings=auth_settings,
132
            async_req=params.get("async_req"),
133
            _return_http_data_only=params.get("_return_http_data_only"),
134
            _preload_content=params.get("_preload_content", True),
135
            _request_timeout=params.get("_request_timeout"),
136
            collection_formats=collection_formats,
137
        )
138

139
    def delete_node(self, node_id, **kwargs):  # noqa: E501
3✔
140
        """Deletes a node  # noqa: E501
141

142
        This method makes a synchronous HTTP request by default. To make an
143
        asynchronous HTTP request, please pass async_req=True
144
        >>> thread = api.delete_node(node_id, async_req=True)
145
        >>> result = thread.get()
146

147
        :param async_req bool
148
        :param int node_id: ID of node to delete (required)
149
        :param str api_key:
150
        :return: None
151
                 If the method is called asynchronously,
152
                 returns the request thread.
153
        """
NEW
154
        kwargs["_return_http_data_only"] = True
×
NEW
155
        if kwargs.get("async_req"):
×
156
            return self.delete_node_with_http_info(node_id, **kwargs)  # noqa: E501
×
157
        else:
158
            (data) = self.delete_node_with_http_info(node_id, **kwargs)  # noqa: E501
×
159
            return data
×
160

161
    def delete_node_with_http_info(self, node_id, **kwargs):  # noqa: E501
3✔
162
        """Deletes a node  # noqa: E501
163

164
        This method makes a synchronous HTTP request by default. To make an
165
        asynchronous HTTP request, please pass async_req=True
166
        >>> thread = api.delete_node_with_http_info(node_id, async_req=True)
167
        >>> result = thread.get()
168

169
        :param async_req bool
170
        :param int node_id: ID of node to delete (required)
171
        :param str api_key:
172
        :return: None
173
                 If the method is called asynchronously,
174
                 returns the request thread.
175
        """
176

NEW
177
        all_params = ["node_id", "api_key"]  # noqa: E501
×
NEW
178
        all_params.append("async_req")
×
NEW
179
        all_params.append("_return_http_data_only")
×
NEW
180
        all_params.append("_preload_content")
×
NEW
181
        all_params.append("_request_timeout")
×
182

183
        params = locals()
×
NEW
184
        for key, val in six.iteritems(params["kwargs"]):
×
185
            if key not in all_params:
×
186
                raise TypeError(
×
187
                    "Got an unexpected keyword argument '%s'"
188
                    " to method delete_node" % key
189
                )
190
            params[key] = val
×
NEW
191
        del params["kwargs"]
×
192
        # verify the required parameter 'node_id' is set
NEW
193
        if "node_id" not in params or params["node_id"] is None:
×
NEW
194
            raise ValueError(
×
195
                "Missing the required parameter `node_id` when calling `delete_node`"
196
            )  # noqa: E501
197

198
        collection_formats = {}
×
199

200
        path_params = {}
×
201

202
        query_params = []
×
NEW
203
        if "node_id" in params:
×
NEW
204
            query_params.append(("nodeId", params["node_id"]))  # noqa: E501
×
205

206
        header_params = {}
×
NEW
207
        if "api_key" in params:
×
NEW
208
            header_params["api_key"] = params["api_key"]  # noqa: E501
×
209

210
        form_params = []
×
211
        local_var_files = {}
×
212

213
        body_params = None
×
214
        # Authentication setting
215
        auth_settings = []  # noqa: E501
×
216

217
        return self.api_client.call_api(
×
218
            "/node",
219
            "DELETE",
220
            path_params,
221
            query_params,
222
            header_params,
223
            body=body_params,
224
            post_params=form_params,
225
            files=local_var_files,
226
            response_type=None,  # noqa: E501
227
            auth_settings=auth_settings,
228
            async_req=params.get("async_req"),
229
            _return_http_data_only=params.get("_return_http_data_only"),
230
            _preload_content=params.get("_preload_content", True),
231
            _request_timeout=params.get("_request_timeout"),
232
            collection_formats=collection_formats,
233
        )
234

235
    def get_node(self, **kwargs):  # noqa: E501
3✔
236
        """get an existing node  # noqa: E501
237

238
        ID of the node  # noqa: E501
239
        This method makes a synchronous HTTP request by default. To make an
240
        asynchronous HTTP request, please pass async_req=True
241
        >>> thread = api.get_node(async_req=True)
242
        >>> result = thread.get()
243

244
        :param async_req bool
245
        :return: None
246
                 If the method is called asynchronously,
247
                 returns the request thread.
248
        """
NEW
249
        kwargs["_return_http_data_only"] = True
×
NEW
250
        if kwargs.get("async_req"):
×
251
            return self.get_node_with_http_info(**kwargs)  # noqa: E501
×
252
        else:
253
            (data) = self.get_node_with_http_info(**kwargs)  # noqa: E501
×
254
            return data
×
255

256
    def get_node_with_http_info(self, **kwargs):  # noqa: E501
3✔
257
        """get an existing node  # noqa: E501
258

259
        ID of the node  # noqa: E501
260
        This method makes a synchronous HTTP request by default. To make an
261
        asynchronous HTTP request, please pass async_req=True
262
        >>> thread = api.get_node_with_http_info(async_req=True)
263
        >>> result = thread.get()
264

265
        :param async_req bool
266
        :return: None
267
                 If the method is called asynchronously,
268
                 returns the request thread.
269
        """
270

271
        all_params = []  # noqa: E501
×
NEW
272
        all_params.append("async_req")
×
NEW
273
        all_params.append("_return_http_data_only")
×
NEW
274
        all_params.append("_preload_content")
×
NEW
275
        all_params.append("_request_timeout")
×
276

277
        params = locals()
×
NEW
278
        for key, val in six.iteritems(params["kwargs"]):
×
279
            if key not in all_params:
×
280
                raise TypeError(
×
281
                    "Got an unexpected keyword argument '%s'"
282
                    " to method get_node" % key
283
                )
284
            params[key] = val
×
NEW
285
        del params["kwargs"]
×
286

287
        collection_formats = {}
×
288

289
        path_params = {}
×
290

291
        query_params = []
×
292

293
        header_params = {}
×
294

295
        form_params = []
×
296
        local_var_files = {}
×
297

298
        body_params = None
×
299
        # Authentication setting
300
        auth_settings = []  # noqa: E501
×
301

302
        return self.api_client.call_api(
×
303
            "/node",
304
            "GET",
305
            path_params,
306
            query_params,
307
            header_params,
308
            body=body_params,
309
            post_params=form_params,
310
            files=local_var_files,
311
            response_type=None,  # noqa: E501
312
            auth_settings=auth_settings,
313
            async_req=params.get("async_req"),
314
            _return_http_data_only=params.get("_return_http_data_only"),
315
            _preload_content=params.get("_preload_content", True),
316
            _request_timeout=params.get("_request_timeout"),
317
            collection_formats=collection_formats,
318
        )
319

320
    def update_node(self, body, **kwargs):  # noqa: E501
3✔
321
        """Update an existing node  # noqa: E501
322

323
        ID of node that needs to be updated.  # noqa: E501
324
        This method makes a synchronous HTTP request by default. To make an
325
        asynchronous HTTP request, please pass async_req=True
326
        >>> thread = api.update_node(body, async_req=True)
327
        >>> result = thread.get()
328

329
        :param async_req bool
330
        :param Node body: node object that needs to be sent to the SDX LC (required)
331
        :return: None
332
                 If the method is called asynchronously,
333
                 returns the request thread.
334
        """
NEW
335
        kwargs["_return_http_data_only"] = True
×
NEW
336
        if kwargs.get("async_req"):
×
337
            return self.update_node_with_http_info(body, **kwargs)  # noqa: E501
×
338
        else:
339
            (data) = self.update_node_with_http_info(body, **kwargs)  # noqa: E501
×
340
            return data
×
341

342
    def update_node_with_http_info(self, body, **kwargs):  # noqa: E501
3✔
343
        """Update an existing node  # noqa: E501
344

345
        ID of node that needs to be updated.  # noqa: E501
346
        This method makes a synchronous HTTP request by default. To make an
347
        asynchronous HTTP request, please pass async_req=True
348
        >>> thread = api.update_node_with_http_info(body, async_req=True)
349
        >>> result = thread.get()
350

351
        :param async_req bool
352
        :param Node body: node object that needs to be sent to the SDX LC (required)
353
        :return: None
354
                 If the method is called asynchronously,
355
                 returns the request thread.
356
        """
357

NEW
358
        all_params = ["body"]  # noqa: E501
×
NEW
359
        all_params.append("async_req")
×
NEW
360
        all_params.append("_return_http_data_only")
×
NEW
361
        all_params.append("_preload_content")
×
NEW
362
        all_params.append("_request_timeout")
×
363

364
        params = locals()
×
NEW
365
        for key, val in six.iteritems(params["kwargs"]):
×
366
            if key not in all_params:
×
367
                raise TypeError(
×
368
                    "Got an unexpected keyword argument '%s'"
369
                    " to method update_node" % key
370
                )
371
            params[key] = val
×
NEW
372
        del params["kwargs"]
×
373
        # verify the required parameter 'body' is set
NEW
374
        if "body" not in params or params["body"] is None:
×
NEW
375
            raise ValueError(
×
376
                "Missing the required parameter `body` when calling `update_node`"
377
            )  # noqa: E501
378

379
        collection_formats = {}
×
380

381
        path_params = {}
×
382

383
        query_params = []
×
384

385
        header_params = {}
×
386

387
        form_params = []
×
388
        local_var_files = {}
×
389

390
        body_params = None
×
NEW
391
        if "body" in params:
×
NEW
392
            body_params = params["body"]
×
393
        # HTTP header `Content-Type`
NEW
394
        header_params[
×
395
            "Content-Type"
396
        ] = self.api_client.select_header_content_type(  # noqa: E501
397
            ["application/json"]
398
        )  # noqa: E501
399

400
        # Authentication setting
401
        auth_settings = []  # noqa: E501
×
402

403
        return self.api_client.call_api(
×
404
            "/node",
405
            "PUT",
406
            path_params,
407
            query_params,
408
            header_params,
409
            body=body_params,
410
            post_params=form_params,
411
            files=local_var_files,
412
            response_type=None,  # noqa: E501
413
            auth_settings=auth_settings,
414
            async_req=params.get("async_req"),
415
            _return_http_data_only=params.get("_return_http_data_only"),
416
            _preload_content=params.get("_preload_content", True),
417
            _request_timeout=params.get("_request_timeout"),
418
            collection_formats=collection_formats,
419
        )
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc