baiducloud-python-sdk-snic 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. baiducloud-python-sdk-snic-0.0.1/ChangeLog.md +5 -0
  2. baiducloud-python-sdk-snic-0.0.1/LICENSE +177 -0
  3. baiducloud-python-sdk-snic-0.0.1/MANIFEST.in +2 -0
  4. baiducloud-python-sdk-snic-0.0.1/PKG-INFO +72 -0
  5. baiducloud-python-sdk-snic-0.0.1/README-CN.md +38 -0
  6. baiducloud-python-sdk-snic-0.0.1/README.md +38 -0
  7. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/__init__.py +5 -0
  8. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/api/__init__.py +0 -0
  9. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/api/snic_client.py +309 -0
  10. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/__init__.py +19 -0
  11. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/billing.py +68 -0
  12. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/create_snic_request.py +153 -0
  13. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/create_snic_response.py +69 -0
  14. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/delete_snic_request.py +64 -0
  15. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/describe_snic_request.py +58 -0
  16. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/describe_snic_response.py +155 -0
  17. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/endpoint.py +142 -0
  18. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/list_snic_request.py +102 -0
  19. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/list_snic_response.py +94 -0
  20. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/query_available_public_services_response.py +61 -0
  21. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/reservation.py +66 -0
  22. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/tag_model.py +66 -0
  23. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/update_snic_esg_request.py +72 -0
  24. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/update_snic_request.py +80 -0
  25. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic/models/update_snic_sg_request.py +72 -0
  26. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic.egg-info/PKG-INFO +72 -0
  27. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic.egg-info/SOURCES.txt +31 -0
  28. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic.egg-info/dependency_links.txt +1 -0
  29. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic.egg-info/requires.txt +4 -0
  30. baiducloud-python-sdk-snic-0.0.1/baiducloud_python_sdk_snic.egg-info/top_level.txt +1 -0
  31. baiducloud-python-sdk-snic-0.0.1/setup.cfg +7 -0
  32. baiducloud-python-sdk-snic-0.0.1/setup.py +71 -0
@@ -0,0 +1,5 @@
1
+ 2026-05-14 Version: 0.0.1
2
+ - 涉及产品: SNIC,支持查询服务网卡详情及列表
3
+ - 涉及产品: SNIC,支持创建、更新、删除服务网卡
4
+ - 涉及产品: SNIC,支持更新服务网卡企业安全组和普通安全组
5
+ - 涉及产品: SNIC,支持查询可挂载的公共服务
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
@@ -0,0 +1,2 @@
1
+ include LICENSE
2
+ include *.md
@@ -0,0 +1,72 @@
1
+ Metadata-Version: 2.1
2
+ Name: baiducloud-python-sdk-snic
3
+ Version: 0.0.1
4
+ Summary: Baidu Cloud snicApi SDK Library for Python
5
+ Home-page: https://github.com/baidubce/baiducloud-python-sdk
6
+ Author: Baidu Cloud SDK
7
+ Author-email:
8
+ License: Apache License 2.0
9
+ Project-URL: Source, https://github.com/baidubce/baiducloud-python-sdk
10
+ Project-URL: Documentation, https://github.com/baidubce/baiducloud-python-sdk/tree/master/docs
11
+ Project-URL: Changelog, https://github.com/baidubce/baiducloud-python-sdk/blob/master/baiducloud-python-sdk-snic/ChangeLog.md
12
+ Keywords: baiducloud,snic
13
+ Platform: UNKNOWN
14
+ Classifier: Development Status :: 5 - Production/Stable
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 2
19
+ Classifier: Programming Language :: Python :: 2.7
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Programming Language :: Python :: 3.3
22
+ Classifier: Programming Language :: Python :: 3.4
23
+ Classifier: Programming Language :: Python :: 3.5
24
+ Classifier: Programming Language :: Python :: 3.6
25
+ Classifier: Programming Language :: Python :: 3.7
26
+ Classifier: Programming Language :: Python :: 3.8
27
+ Classifier: Programming Language :: Python :: 3.9
28
+ Classifier: Programming Language :: Python :: 3.10
29
+ Classifier: Programming Language :: Python :: 3.11
30
+ Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4
31
+ Description-Content-Type: text/markdown
32
+ License-File: LICENSE
33
+
34
+ English | [简体中文](README-CN.md)
35
+
36
+ ## Baidu Cloud snicApi SDK for Python
37
+
38
+ ## Requirements
39
+
40
+ - Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4
41
+
42
+ ## Installation
43
+
44
+ - **Install with pip**
45
+
46
+ Python SDK uses a common package management tool named `pip`. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") to install pip.
47
+
48
+ ```bash
49
+ # Install the baiducloud_python_sdk_snic
50
+ pip install baiducloud_python_sdk_snic
51
+ ```
52
+
53
+ ## Issues
54
+
55
+ [Opening an Issue](https://github.com/baidubce/baiducloud-python-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.
56
+
57
+ ## Usage
58
+
59
+ [Quick Examples](https://github.com/baidubce/baiducloud-python-sdk/blob/master/docs/Usage-EN.md)
60
+
61
+ ## Changelog
62
+
63
+ Detailed changes for each release are documented in the [release notes](./ChangeLog.md).
64
+
65
+ ## References
66
+
67
+ - [Latest Release](https://github.com/baidubce/baiducloud-python-sdk)
68
+
69
+ ## License
70
+
71
+ [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
72
+
@@ -0,0 +1,38 @@
1
+ [English](README.md) | 简体中文
2
+
3
+ ## Baidu Cloud snicApi SDK for Python
4
+
5
+ ## 要求
6
+
7
+ - Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4
8
+
9
+ ## 安装
10
+
11
+ - **使用 pip 安装(推荐)**
12
+
13
+ 如未安装 `pip`, 请先至pip官网 [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") 安装pip .
14
+
15
+ ```bash
16
+ # 安装 baiducloud_python_sdk_snic
17
+ pip install baiducloud_python_sdk_snic
18
+ ```
19
+
20
+ ## 问题
21
+
22
+ [提交 Issue](https://github.com/baidubce/baiducloud-python-sdk/issues/new),不符合指南的问题可能会立即关闭。
23
+
24
+ ## 使用说明
25
+
26
+ [快速使用](https://github.com/baidubce/baiducloud-python-sdk/blob/master/docs/Usage-CN.md)
27
+
28
+ ## 发行说明
29
+
30
+ 每个版本的详细更改记录在[发行说明](./ChangeLog.md)中。
31
+
32
+ ## 相关
33
+
34
+ - [最新源码](https://github.com/baidubce/baiducloud-python-sdk)
35
+
36
+ ## 许可证
37
+
38
+ [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
@@ -0,0 +1,38 @@
1
+ English | [简体中文](README-CN.md)
2
+
3
+ ## Baidu Cloud snicApi SDK for Python
4
+
5
+ ## Requirements
6
+
7
+ - Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, <4
8
+
9
+ ## Installation
10
+
11
+ - **Install with pip**
12
+
13
+ Python SDK uses a common package management tool named `pip`. If pip is not installed, see the [pip user guide](https://pip.pypa.io/en/stable/installing/ "pip User Guide") to install pip.
14
+
15
+ ```bash
16
+ # Install the baiducloud_python_sdk_snic
17
+ pip install baiducloud_python_sdk_snic
18
+ ```
19
+
20
+ ## Issues
21
+
22
+ [Opening an Issue](https://github.com/baidubce/baiducloud-python-sdk/issues/new), Issues not conforming to the guidelines may be closed immediately.
23
+
24
+ ## Usage
25
+
26
+ [Quick Examples](https://github.com/baidubce/baiducloud-python-sdk/blob/master/docs/Usage-EN.md)
27
+
28
+ ## Changelog
29
+
30
+ Detailed changes for each release are documented in the [release notes](./ChangeLog.md).
31
+
32
+ ## References
33
+
34
+ - [Latest Release](https://github.com/baidubce/baiducloud-python-sdk)
35
+
36
+ ## License
37
+
38
+ [Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
@@ -0,0 +1,5 @@
1
+ """
2
+ This module defines some common string constants.
3
+ """
4
+
5
+ SDK_VERSION = b'0.0.1'
@@ -0,0 +1,309 @@
1
+ """
2
+ Example for snic client.
3
+ """
4
+
5
+ import copy
6
+ import logging
7
+
8
+ from baiducloud_python_sdk_core import utils, bce_base_client
9
+ from baiducloud_python_sdk_core.auth import bce_v1_signer
10
+ from baiducloud_python_sdk_core.bce_base_client import BceBaseClient
11
+ from baiducloud_python_sdk_core.http import bce_http_client
12
+ from baiducloud_python_sdk_core.http import handler
13
+ from baiducloud_python_sdk_core.http import http_methods
14
+ from baiducloud_python_sdk_snic.models.create_snic_response import CreateSnicResponse
15
+ from baiducloud_python_sdk_snic.models.describe_snic_response import DescribeSnicResponse
16
+ from baiducloud_python_sdk_snic.models.list_snic_response import ListSnicResponse
17
+ from baiducloud_python_sdk_snic.models.query_available_public_services_response import (
18
+ QueryAvailablePublicServicesResponse,
19
+ )
20
+
21
+ _logger = logging.getLogger(__name__)
22
+
23
+
24
+ class SnicClient(BceBaseClient):
25
+ """
26
+ snic base sdk client
27
+ """
28
+
29
+ VERSION_V1 = b'/v1'
30
+
31
+ CONSTANT_ENDPOINT = b'endpoint'
32
+
33
+ CONSTANT_PUBLIC_SERVICE = b'publicService'
34
+
35
+ def __init__(self, config=None):
36
+ """
37
+ Initialize the snic client.
38
+
39
+ :param config: Client configuration
40
+ :type config: baidubce.BceClientConfiguration
41
+ """
42
+ bce_base_client.BceBaseClient.__init__(self, config)
43
+
44
+ def create_snic(self, request, config=None):
45
+ """
46
+ create_snic
47
+
48
+ :param request: Request entity containing all parameters
49
+ :type request: SnicClientRequest
50
+ :param config: Optional request configuration override
51
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
52
+
53
+ :return: API response containing CreateSnicResponse data
54
+ :rtype: CreateSnicResponse
55
+
56
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
57
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
58
+ """
59
+ path = utils.append_uri(SnicClient.VERSION_V1, SnicClient.CONSTANT_ENDPOINT)
60
+ headers = None
61
+ params = {}
62
+ if request.client_token is not None:
63
+ params['clientToken'] = request.client_token
64
+ merged_config = self._create_request_with_host(request, config)
65
+ return self._send_request(
66
+ http_methods.POST,
67
+ path=path,
68
+ body=request.to_json_string(),
69
+ params=params,
70
+ config=merged_config,
71
+ model=CreateSnicResponse,
72
+ )
73
+
74
+ def delete_snic(self, request, config=None):
75
+ """
76
+ delete_snic
77
+
78
+ :param request: Request entity containing all parameters
79
+ :type request: SnicClientRequest
80
+ :param config: Optional request configuration override
81
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
82
+
83
+ :return: API response
84
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
85
+
86
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
87
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
88
+ """
89
+ path = utils.append_uri(SnicClient.VERSION_V1, SnicClient.CONSTANT_ENDPOINT, request.endpoint_id)
90
+ headers = None
91
+ params = {}
92
+ if request.client_token is not None:
93
+ params['clientToken'] = request.client_token
94
+ merged_config = self._create_request_with_host(request, config)
95
+ return self._send_request(http_methods.DELETE, path=path, params=params, config=merged_config)
96
+
97
+ def describe_snic(self, request, config=None):
98
+ """
99
+ describe_snic
100
+
101
+ :param request: Request entity containing all parameters
102
+ :type request: SnicClientRequest
103
+ :param config: Optional request configuration override
104
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
105
+
106
+ :return: API response containing DescribeSnicResponse data
107
+ :rtype: DescribeSnicResponse
108
+
109
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
110
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
111
+ """
112
+ path = utils.append_uri(SnicClient.VERSION_V1, SnicClient.CONSTANT_ENDPOINT, request.endpoint_id)
113
+ headers = None
114
+ merged_config = self._create_request_with_host(request, config)
115
+ return self._send_request(http_methods.GET, path=path, config=merged_config, model=DescribeSnicResponse)
116
+
117
+ def list_snic(self, request, config=None):
118
+ """
119
+ list_snic
120
+
121
+ :param request: Request entity containing all parameters
122
+ :type request: SnicClientRequest
123
+ :param config: Optional request configuration override
124
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
125
+
126
+ :return: API response containing ListSnicResponse data
127
+ :rtype: ListSnicResponse
128
+
129
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
130
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
131
+ """
132
+ path = utils.append_uri(SnicClient.VERSION_V1, SnicClient.CONSTANT_ENDPOINT)
133
+ headers = None
134
+ params = {}
135
+ if request.vpc_id is not None:
136
+ params['vpcId'] = request.vpc_id
137
+ if request.name is not None:
138
+ params['name'] = request.name
139
+ if request.ip_address is not None:
140
+ params['ipAddress'] = request.ip_address
141
+ if request.status is not None:
142
+ params['status'] = request.status
143
+ if request.subnet_id is not None:
144
+ params['subnetId'] = request.subnet_id
145
+ if request.service is not None:
146
+ params['service'] = request.service
147
+ if request.marker is not None:
148
+ params['marker'] = request.marker
149
+ if request.max_keys is not None:
150
+ params['maxKeys'] = request.max_keys
151
+ merged_config = self._create_request_with_host(request, config)
152
+ return self._send_request(
153
+ http_methods.GET, path=path, params=params, config=merged_config, model=ListSnicResponse
154
+ )
155
+
156
+ def query_available_public_services(self, config=None):
157
+ """
158
+ query_available_public_services
159
+ :param config: Optional request configuration override
160
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
161
+
162
+ :return: API response containing QueryAvailablePublicServicesResponse data
163
+ :rtype: QueryAvailablePublicServicesResponse
164
+
165
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
166
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
167
+ """
168
+ path = utils.append_uri(
169
+ SnicClient.VERSION_V1, SnicClient.CONSTANT_ENDPOINT, SnicClient.CONSTANT_PUBLIC_SERVICE
170
+ )
171
+ headers = None
172
+ return self._send_request(
173
+ http_methods.GET, path=path, config=config, model=QueryAvailablePublicServicesResponse
174
+ )
175
+
176
+ def update_snic(self, request, config=None):
177
+ """
178
+ update_snic
179
+
180
+ :param request: Request entity containing all parameters
181
+ :type request: SnicClientRequest
182
+ :param config: Optional request configuration override
183
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
184
+
185
+ :return: API response
186
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
187
+
188
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
189
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
190
+ """
191
+ path = utils.append_uri(SnicClient.VERSION_V1, SnicClient.CONSTANT_ENDPOINT, request.endpoint_id)
192
+ headers = None
193
+ params = {}
194
+ if request.client_token is not None:
195
+ params['clientToken'] = request.client_token
196
+ merged_config = self._create_request_with_host(request, config)
197
+ return self._send_request(
198
+ http_methods.PUT, path=path, body=request.to_json_string(), params=params, config=merged_config
199
+ )
200
+
201
+ def update_snic_esg(self, request, config=None):
202
+ """
203
+ update_snic_esg
204
+
205
+ :param request: Request entity containing all parameters
206
+ :type request: SnicClientRequest
207
+ :param config: Optional request configuration override
208
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
209
+
210
+ :return: API response
211
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
212
+
213
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
214
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
215
+ """
216
+ path = utils.append_uri(SnicClient.VERSION_V1, SnicClient.CONSTANT_ENDPOINT, request.endpoint_id)
217
+ headers = None
218
+ params = {}
219
+ params['bindEsg'] = None
220
+ if request.client_token is not None:
221
+ params['clientToken'] = request.client_token
222
+ merged_config = self._create_request_with_host(request, config)
223
+ return self._send_request(
224
+ http_methods.PUT, path=path, body=request.to_json_string(), params=params, config=merged_config
225
+ )
226
+
227
+ def update_snic_sg(self, request, config=None):
228
+ """
229
+ update_snic_sg
230
+
231
+ :param request: Request entity containing all parameters
232
+ :type request: SnicClientRequest
233
+ :param config: Optional request configuration override
234
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
235
+
236
+ :return: API response
237
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
238
+
239
+ :raises BceClientError: Client error (network failure, invalid parameters, etc.)
240
+ :raises BceServerError: Server error (4xx/5xx HTTP status codes)
241
+ """
242
+ path = utils.append_uri(SnicClient.VERSION_V1, SnicClient.CONSTANT_ENDPOINT, request.endpoint_id)
243
+ headers = None
244
+ params = {}
245
+ params['bindSg'] = None
246
+ if request.client_token is not None:
247
+ params['clientToken'] = request.client_token
248
+ merged_config = self._create_request_with_host(request, config)
249
+ return self._send_request(
250
+ http_methods.PUT, path=path, body=request.to_json_string(), params=params, config=merged_config
251
+ )
252
+
253
+ def _merge_config(self, config=None):
254
+ """
255
+ :param config:
256
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
257
+ """
258
+ if config is None:
259
+ return self.config
260
+ else:
261
+ new_config = copy.copy(self.config)
262
+ new_config.merge_non_none_values(config)
263
+ return new_config
264
+
265
+ def _send_request(
266
+ self, http_method, path, body=None, headers=None, params=None, config=None, body_parser=None, model=None
267
+ ):
268
+ """
269
+ Send an HTTP request to the service endpoint.
270
+
271
+ :param http_method: HTTP method (GET, POST, PUT, DELETE, etc.)
272
+ :type http_method: bytes
273
+ :param path: Request path
274
+ :type path: bytes
275
+ :param body: Optional request body
276
+ :type body: str or bytes
277
+ :param headers: Optional HTTP headers
278
+ :type headers: dict
279
+ :param params: Optional query parameters
280
+ :type params: dict
281
+ :param config: Optional request configuration override
282
+ :type config: baiducloud_python_sdk_core.BceClientConfiguration
283
+ :param body_parser: Optional custom body parser function
284
+ :type body_parser: callable
285
+ :param model: Optional response model class for deserialization
286
+ :type model: class
287
+
288
+ :return: API response
289
+ :rtype: baiducloud_python_sdk_core.bce_response.BceResponse
290
+
291
+ :raises BceClientError: Client error (network connection failure, SSL errors, etc.)
292
+ :raises BceServerError: Server returned error response
293
+ """
294
+ config = self._merge_config(config)
295
+ if body_parser is None:
296
+ body_parser = handler.parse_json
297
+ if headers is None:
298
+ headers = {b'Accept': b'*/*', b'Content-Type': b'application/json;charset=utf-8'}
299
+ return bce_http_client.send_request(
300
+ config,
301
+ bce_v1_signer.sign,
302
+ [handler.parse_error, body_parser],
303
+ http_method,
304
+ path,
305
+ body,
306
+ headers,
307
+ params,
308
+ model=model,
309
+ )
@@ -0,0 +1,19 @@
1
+ """
2
+ Models for snic SDK.
3
+ """
4
+
5
+ from .billing import Billing
6
+ from .create_snic_request import CreateSnicRequest
7
+ from .create_snic_response import CreateSnicResponse
8
+ from .describe_snic_response import DescribeSnicResponse
9
+ from .endpoint import Endpoint
10
+ from .list_snic_response import ListSnicResponse
11
+ from .query_available_public_services_response import QueryAvailablePublicServicesResponse
12
+ from .reservation import Reservation
13
+ from .tag_model import TagModel
14
+ from .update_snic_esg_request import UpdateSnicEsgRequest
15
+ from .update_snic_request import UpdateSnicRequest
16
+ from .update_snic_sg_request import UpdateSnicSgRequest
17
+ from .delete_snic_request import DeleteSnicRequest
18
+ from .list_snic_request import ListSnicRequest
19
+ from .describe_snic_request import DescribeSnicRequest