Skip to content

Commit 8693c45

Browse files
shenwen.yinSczlog
authored andcommitted
update to v2.20.0 schema
1 parent b356446 commit 8693c45

File tree

194 files changed

+79236
-3254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+79236
-3254
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,5 @@ target/
6464

6565
#Ipython Notebook
6666
.ipynb_checkpoints
67+
68+
.vscode

.openapi-generator/FILES

Lines changed: 132 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ Python 环境下的 Cloudtower SDK,适用于 2.7 与 3.4 以上版本。
1111
- ### whl
1212

1313
```shell
14-
pip install cloudtower_sdk-2.19.0-py2.py3-none-any.whl
14+
pip install cloudtower_sdk-2.20.0-py2.py3-none-any.whl
1515
```
1616

1717
- ### tar.gz
1818

1919
```shell
20-
tar xvzf cloudtower-sdk-2.19.0.tar.gz
21-
cd cloudtower-sdk-2.19.0
20+
tar xvzf cloudtower-sdk-2.20.0.tar.gz
21+
cd cloudtower-sdk-2.20.0
2222
python setup.py install
2323
```
2424

RELEASENOTE.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,45 @@
11
# RELEASE NOTE
22

3+
## release 日期 2025-06-09
4+
5+
v2.20.0 release (tower version 4.6.0)
6+
7+
### feature
8+
9+
- [Vm], [VmVolume]: 新增 used_size 与 used_size_usage 字段,用于获取虚拟机与虚拟卷的已使用容量
10+
- [ResourceChangeApi]: 新增 get_resource_change API 用于获取 Resource Change Events
11+
- [PciDeviceApi]: 新增 get_pci_devices API 用于获取 PCI 设备列表
12+
- [TaskApi]: 为 create_task 新增 status 字段,用于指定任务状态
13+
- [ReplicationPlanApi]: 新增 get_replication_plan API 用于获取复制计划列表
14+
- [SmtpServerApi]: 新增 get_smtp_server API 用于获取 SMTP 服务器列表
15+
- [ReplicaVmApi]: 新增 get_replica_vms API 用于获取复制虚拟机列表
16+
- [NetworkPolicyRuleServiceApi]:
17+
- 新增 get_network_policy_rule_services API 用于获取「网络安全」的服务资源
18+
- 新增 create_network_policy_rule_service API 用于创建「网络安全」的服务资源
19+
- 新增 update_network_policy_rule_service API 用于更新「网络安全」的服务资源
20+
- 新增 delete_network_policy_rule_service API 用于删除「网络安全」的服务资源
21+
- [SecurityPolicyApi]: [SecurityPolicyIngressEgressInput]: 支持配置 `service_ids` 用于指定「网络安全」的服务资源
22+
- [SecurityPolicyApi]: [IPSecurityPolicy]: 支持配置 `ip_block`,用于从白名单/黑名单中排除部分 IP
23+
- [IsolationPolicyApi]:
24+
- 新增 create_isolation_policy API 用于创建「隔离策略」
25+
- 新增 update_isolation_policy API 用于更新「隔离策略」
26+
- 新增 delete_isolation_policy API 用于删除「隔离策略」
27+
- [VirtualPrivateCloudExternalSubnetGroupApi]: 新增 get_virtual_private_cloud_external_subnet_groups API 用于获取「外部子网组」
28+
- [VirtualPrivateCloudEdgeGatewayApi]: 新增 get_virtual_private_cloud_edge_gateways API 用于获取「边缘网关」
29+
- [VirtualPrivateCloudEdgeGatewayGroupApi]: 新增 get_virtual_private_cloud_edge_gateway_groups API 用于获取「边缘网关组」
30+
- [VirtualPrivateCloudNatGatewayApi]: [VirtualPrivateCloudNatGatewayCreateParams]: 新增 `external_subnet_group_id` 用于配置外部子网组;新增 `external_ips`,用于配置主备转换地址。
31+
- [VirtualPrivateCloudNatGatewayApi]: [VirtualPrivateCloudRouteGatewayUpdateParams]: 新增 `external_ips`,用于配置主备转换地址。
32+
- [VirtualPrivateCloudRouterGatewayApi]:
33+
- [VirtualPrivateCloudRouterGatewayCreateParams]: 新增 `external_subnet_group_id` 用于配置外部子网组;新增 `external_ips`,用于配置主备转换地址。
34+
- [VirtualPrivateCloudRouterGatewayUpdateParams]: 新增 `external_ips`,用于配置主备转换地址。
35+
- [VirtualPrivateCloudFloatingIPApi]: 新增 batch_create_virtual_private_cloud_floating_ips API,用于批量分配浮动 IP。
36+
37+
### bugfix
38+
39+
- [VmApi]: [get_vm_vnc_info]: 修复生成的 vnc redirect url
40+
- [VmApi]: [add_vm_nic] [update_vm_nic] [update_vm_nic_basic_info]: 修复虚拟机网卡无法正确编辑 ip
41+
- 修复了 setup.py 无法在 python2.7 环境中执行的问题
42+
343
## release 日期 2025-02-17
444

545
v2.19.0 release (tower version 4.5.0)

cloudtower/__init__.py

Lines changed: 133 additions & 1 deletion
Large diffs are not rendered by default.

cloudtower/api/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
from cloudtower.api.gpu_device_api import GpuDeviceApi
4444
from cloudtower.api.graph_api import GraphApi
4545
from cloudtower.api.host_api import HostApi
46+
from cloudtower.api.internal_api import InternalApi
4647
from cloudtower.api.ipmi_api import IpmiApi
4748
from cloudtower.api.iscsi_connection_api import IscsiConnectionApi
4849
from cloudtower.api.iscsi_lun_api import IscsiLunApi
@@ -55,6 +56,7 @@
5556
from cloudtower.api.log_service_config_api import LogServiceConfigApi
5657
from cloudtower.api.metrics_api import MetricsApi
5758
from cloudtower.api.namespace_group_api import NamespaceGroupApi
59+
from cloudtower.api.network_policy_rule_service_api import NetworkPolicyRuleServiceApi
5860
from cloudtower.api.nfs_export_api import NfsExportApi
5961
from cloudtower.api.nfs_inode_api import NfsInodeApi
6062
from cloudtower.api.nic_api import NicApi
@@ -66,12 +68,17 @@
6668
from cloudtower.api.observability_api import ObservabilityApi
6769
from cloudtower.api.organization_api import OrganizationApi
6870
from cloudtower.api.ovf_api import OvfApi
71+
from cloudtower.api.pci_device_api import PciDeviceApi
6972
from cloudtower.api.pmem_dimm_api import PmemDimmApi
7073
from cloudtower.api.rack_topo_api import RackTopoApi
74+
from cloudtower.api.replica_vm_api import ReplicaVmApi
75+
from cloudtower.api.replication_plan_api import ReplicationPlanApi
7176
from cloudtower.api.report_task_api import ReportTaskApi
7277
from cloudtower.api.report_template_api import ReportTemplateApi
78+
from cloudtower.api.resource_change_api import ResourceChangeApi
7379
from cloudtower.api.security_group_api import SecurityGroupApi
7480
from cloudtower.api.security_policy_api import SecurityPolicyApi
81+
from cloudtower.api.smtp_server_api import SmtpServerApi
7582
from cloudtower.api.snapshot_group_api import SnapshotGroupApi
7683
from cloudtower.api.snapshot_plan_api import SnapshotPlanApi
7784
from cloudtower.api.snapshot_plan_task_api import SnapshotPlanTaskApi
@@ -92,7 +99,10 @@
9299
from cloudtower.api.view_api import ViewApi
93100
from cloudtower.api.virtual_private_cloud_api import VirtualPrivateCloudApi
94101
from cloudtower.api.virtual_private_cloud_cluster_binding_api import VirtualPrivateCloudClusterBindingApi
102+
from cloudtower.api.virtual_private_cloud_edge_gateway_api import VirtualPrivateCloudEdgeGatewayApi
103+
from cloudtower.api.virtual_private_cloud_edge_gateway_group_api import VirtualPrivateCloudEdgeGatewayGroupApi
95104
from cloudtower.api.virtual_private_cloud_external_subnet_api import VirtualPrivateCloudExternalSubnetApi
105+
from cloudtower.api.virtual_private_cloud_external_subnet_group_api import VirtualPrivateCloudExternalSubnetGroupApi
96106
from cloudtower.api.virtual_private_cloud_floating_ip_api import VirtualPrivateCloudFloatingIpApi
97107
from cloudtower.api.virtual_private_cloud_nat_gateway_api import VirtualPrivateCloudNatGatewayApi
98108
from cloudtower.api.virtual_private_cloud_route_table_api import VirtualPrivateCloudRouteTableApi

cloudtower/api/internal_api.py

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
# coding: utf-8
2+
from __future__ import absolute_import
3+
4+
import re # noqa: F401
5+
6+
# python 2 and python 3 compatibility library
7+
import six
8+
9+
from cloudtower.api_client import ApiClient
10+
from cloudtower.exceptions import ( # noqa: F401
11+
ApiTypeError,
12+
ApiValueError
13+
)
14+
15+
16+
class InternalApi(object):
17+
"""NOTE: This class is auto generated by OpenAPI Generator
18+
Ref: https://openapi-generator.tech
19+
20+
Do not edit the class manually.
21+
"""
22+
23+
def __init__(self, api_client=None):
24+
if api_client is None:
25+
api_client = ApiClient()
26+
self.api_client = api_client
27+
28+
def get_resource_changes(self, **kwargs): # noqa: E501
29+
"""get_resource_changes # noqa: E501
30+
31+
This method makes a synchronous HTTP request by default. To make an
32+
asynchronous HTTP request, please pass async_req=True
33+
34+
>>> thread = api.get_resource_changes(async_req=True)
35+
>>> result = thread.get()
36+
37+
:param action:
38+
:type action: str
39+
:param resource_type:
40+
:type resource_type: str
41+
:param resource_id:
42+
:type resource_id: str
43+
:param start_revision:
44+
:type start_revision: str
45+
:param limit:
46+
:type limit: int
47+
:param async_req: Whether to execute the request asynchronously.
48+
:type async_req: bool, optional
49+
:param _preload_content: if False, the urllib3.HTTPResponse object will
50+
be returned without reading/decoding response
51+
data. Default is True.
52+
:type _preload_content: bool, optional
53+
:param _request_timeout: timeout setting for this request. If one
54+
number provided, it will be total request
55+
timeout. It can also be a pair (tuple) of
56+
(connection, read) timeouts.
57+
:return: Returns the result object.
58+
If the method is called asynchronously,
59+
returns the request thread.
60+
:rtype: ResourceChangeResponse
61+
"""
62+
kwargs['_return_http_data_only'] = True
63+
return self.get_resource_changes_with_http_info(**kwargs) # noqa: E501
64+
65+
def get_resource_changes_with_http_info(self, **kwargs): # noqa: E501
66+
"""get_resource_changes # noqa: E501
67+
68+
This method makes a synchronous HTTP request by default. To make an
69+
asynchronous HTTP request, please pass async_req=True
70+
71+
>>> thread = api.get_resource_changes_with_http_info(async_req=True)
72+
>>> result = thread.get()
73+
74+
:param action:
75+
:type action: str
76+
:param resource_type:
77+
:type resource_type: str
78+
:param resource_id:
79+
:type resource_id: str
80+
:param start_revision:
81+
:type start_revision: str
82+
:param limit:
83+
:type limit: int
84+
:param async_req: Whether to execute the request asynchronously.
85+
:type async_req: bool, optional
86+
:param _return_http_data_only: response data without head status code
87+
and headers
88+
:type _return_http_data_only: bool, optional
89+
:param _preload_content: if False, the urllib3.HTTPResponse object will
90+
be returned without reading/decoding response
91+
data. Default is True.
92+
:type _preload_content: bool, optional
93+
:param _request_timeout: timeout setting for this request. If one
94+
number provided, it will be total request
95+
timeout. It can also be a pair (tuple) of
96+
(connection, read) timeouts.
97+
:param _request_auth: set to override the auth_settings for an a single
98+
request; this effectively ignores the authentication
99+
in the spec for a single request.
100+
:type _request_auth: dict, optional
101+
:type _content_type: string, optional: force content-type for the request
102+
:return: Returns the result object.
103+
If the method is called asynchronously,
104+
returns the request thread.
105+
:rtype: tuple(ResourceChangeResponse, status_code(int), headers(HTTPHeaderDict))
106+
"""
107+
108+
local_var_params = locals()
109+
110+
all_params = [
111+
'action',
112+
'resource_type',
113+
'resource_id',
114+
'start_revision',
115+
'limit'
116+
]
117+
all_params.extend(
118+
[
119+
'async_req',
120+
'_return_http_data_only',
121+
'_preload_content',
122+
'_request_timeout',
123+
'_request_auth',
124+
'_content_type',
125+
'_headers'
126+
]
127+
)
128+
129+
for key, val in six.iteritems(local_var_params['kwargs']):
130+
if key not in all_params:
131+
raise ApiTypeError(
132+
"Got an unexpected keyword argument '%s'"
133+
" to method get_resource_changes" % key
134+
)
135+
local_var_params[key] = val
136+
del local_var_params['kwargs']
137+
138+
if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000: # noqa: E501
139+
raise ApiValueError("Invalid value for parameter `limit` when calling `get_resource_changes`, must be a value less than or equal to `1000`") # noqa: E501
140+
if self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1: # noqa: E501
141+
raise ApiValueError("Invalid value for parameter `limit` when calling `get_resource_changes`, must be a value greater than or equal to `1`") # noqa: E501
142+
collection_formats = {}
143+
144+
path_params = {}
145+
146+
query_params = []
147+
if 'action' in local_var_params and local_var_params['action'] is not None: # noqa: E501
148+
query_params.append(('action', local_var_params['action'])) # noqa: E501
149+
if 'resource_type' in local_var_params and local_var_params['resource_type'] is not None: # noqa: E501
150+
query_params.append(('resource_type', local_var_params['resource_type'])) # noqa: E501
151+
if 'resource_id' in local_var_params and local_var_params['resource_id'] is not None: # noqa: E501
152+
query_params.append(('resource_id', local_var_params['resource_id'])) # noqa: E501
153+
if 'start_revision' in local_var_params and local_var_params['start_revision'] is not None: # noqa: E501
154+
query_params.append(('start_revision', local_var_params['start_revision'])) # noqa: E501
155+
if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
156+
query_params.append(('limit', local_var_params['limit'])) # noqa: E501
157+
158+
header_params = dict(local_var_params.get('_headers', {}))
159+
160+
form_params = []
161+
local_var_files = {}
162+
163+
body_params = None
164+
# HTTP header `Accept`
165+
header_params['Accept'] = self.api_client.select_header_accept(
166+
['application/json']) # noqa: E501
167+
168+
# Authentication setting
169+
auth_settings = ['Basic'] # noqa: E501
170+
171+
response_types_map = {
172+
200: "ResourceChangeResponse",
173+
400: "ErrorBody",
174+
404: "ErrorBody",
175+
500: "ErrorBody",
176+
}
177+
178+
return self.api_client.call_api(
179+
'/resource-changes', 'GET',
180+
path_params,
181+
query_params,
182+
header_params,
183+
body=body_params,
184+
post_params=form_params,
185+
files=local_var_files,
186+
response_types_map=response_types_map,
187+
auth_settings=auth_settings,
188+
async_req=local_var_params.get('async_req'),
189+
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
190+
_preload_content=local_var_params.get('_preload_content', True),
191+
_request_timeout=local_var_params.get('_request_timeout'),
192+
collection_formats=collection_formats,
193+
_request_auth=local_var_params.get('_request_auth'))

0 commit comments

Comments
 (0)