baiducloud-python-sdk-snic 0.0.1__py3-none-any.whl

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.
@@ -0,0 +1,58 @@
1
+ """
2
+ Request entity for DescribeSnicRequest information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class DescribeSnicRequest(AbstractModel):
9
+ """
10
+ Request entity for DescribeSnicRequest operation.
11
+
12
+ This class encapsulates all parameters for the API request.
13
+ """
14
+
15
+ def __init__(self, endpoint_id):
16
+ """
17
+ Initialize DescribeSnicRequest request entity.
18
+
19
+ :param endpoint_id: endpoint_id parameter
20
+ :type endpoint_id: str (required)
21
+ """
22
+ super().__init__()
23
+ self.endpoint_id = endpoint_id
24
+
25
+ def to_dict(self):
26
+ """
27
+ Convert the request entity to a dictionary representation.
28
+
29
+ Nested model objects are recursively converted to dictionaries.
30
+
31
+ :return: Dictionary representation of the request
32
+ :rtype: dict
33
+ """
34
+ _map = super().to_dict()
35
+ if _map is not None:
36
+ return _map
37
+ result = dict()
38
+ return result
39
+
40
+ def from_dict(self, m):
41
+ """
42
+ Populate the request entity from a dictionary.
43
+
44
+ Nested dictionaries are recursively converted to model objects.
45
+
46
+ :param m: Dictionary containing request data
47
+ :type m: dict
48
+
49
+ :return: Self reference for method chaining
50
+ :rtype: DescribeSnicRequest
51
+
52
+ :raises TypeError: If input is not a dictionary or field type mismatch
53
+ :raises ValueError: If nested model conversion fails
54
+ """
55
+ m = m or dict()
56
+ if m.get('endpointId') is not None:
57
+ self.endpoint_id = m.get('endpointId')
58
+ return self
@@ -0,0 +1,155 @@
1
+ """
2
+ Request entity for DescribeSnicResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+ from baiducloud_python_sdk_snic.models.tag_model import TagModel
7
+
8
+
9
+ class DescribeSnicResponse(BceResponse):
10
+ """
11
+ DescribeSnicResponse
12
+ """
13
+
14
+ def __init__(
15
+ self,
16
+ endpoint_id=None,
17
+ name=None,
18
+ ip_address=None,
19
+ status=None,
20
+ service=None,
21
+ subnet_id=None,
22
+ description=None,
23
+ create_time=None,
24
+ product_type=None,
25
+ vpc_id=None,
26
+ tags=None,
27
+ ):
28
+ """
29
+ Initialize DescribeSnicResponse response.
30
+
31
+ :param endpoint_id: 服务网卡的id
32
+ :type endpoint_id: str (optional)
33
+
34
+ :param name: 服务网卡的名称
35
+ :type name: str (optional)
36
+
37
+ :param ip_address: 服务网卡ip
38
+ :type ip_address: str (optional)
39
+
40
+ :param status: 服务网卡状态,取值:available/dead,分别表示:可挂载/不可挂载
41
+ :type status: str (optional)
42
+
43
+ :param service: 服务唯一域名
44
+ :type service: str (optional)
45
+
46
+ :param subnet_id: 子网id
47
+ :type subnet_id: str (optional)
48
+
49
+ :param description: 描述
50
+ :type description: str (optional)
51
+
52
+ :param create_time: 创建时间
53
+ :type create_time: str (optional)
54
+
55
+ :param product_type: 付费类型
56
+ :type product_type: str (optional)
57
+
58
+ :param vpc_id: vpc的id
59
+ :type vpc_id: str (optional)
60
+
61
+ :param tags: 标签
62
+ :type tags: List[TagModel] (optional)
63
+ """
64
+ super().__init__()
65
+ self.endpoint_id = endpoint_id
66
+ self.name = name
67
+ self.ip_address = ip_address
68
+ self.status = status
69
+ self.service = service
70
+ self.subnet_id = subnet_id
71
+ self.description = description
72
+ self.create_time = create_time
73
+ self.product_type = product_type
74
+ self.vpc_id = vpc_id
75
+ self.tags = tags
76
+
77
+ def to_dict(self):
78
+ """
79
+ Convert the response instance to a dictionary representation.
80
+
81
+ Includes metadata from the parent BceResponse class.
82
+ Nested model objects are recursively converted to dictionaries.
83
+
84
+ :return: Dictionary representation of the response
85
+ :rtype: dict
86
+ """
87
+ _map = super().to_dict()
88
+ if _map is not None:
89
+ return _map
90
+ result = dict()
91
+ if self.metadata is not None:
92
+ result['metadata'] = dict(self.metadata)
93
+ if self.endpoint_id is not None:
94
+ result['endpointId'] = self.endpoint_id
95
+ if self.name is not None:
96
+ result['name'] = self.name
97
+ if self.ip_address is not None:
98
+ result['ipAddress'] = self.ip_address
99
+ if self.status is not None:
100
+ result['status'] = self.status
101
+ if self.service is not None:
102
+ result['service'] = self.service
103
+ if self.subnet_id is not None:
104
+ result['subnetId'] = self.subnet_id
105
+ if self.description is not None:
106
+ result['description'] = self.description
107
+ if self.create_time is not None:
108
+ result['createTime'] = self.create_time
109
+ if self.product_type is not None:
110
+ result['productType'] = self.product_type
111
+ if self.vpc_id is not None:
112
+ result['vpcId'] = self.vpc_id
113
+ if self.tags is not None:
114
+ result['tags'] = [i.to_dict() for i in self.tags]
115
+ return result
116
+
117
+ def from_dict(self, m):
118
+ """
119
+ Populate the response instance from a dictionary.
120
+
121
+ Nested dictionaries are recursively converted to model objects.
122
+
123
+ :param m: Dictionary containing response data
124
+ :type m: dict
125
+
126
+ :return: Self reference for method chaining
127
+ :rtype: DescribeSnicResponse
128
+
129
+ :raises TypeError: If input is not a dictionary or field type mismatch
130
+ :raises ValueError: If nested model conversion fails
131
+ """
132
+ m = m or dict()
133
+ if m.get('endpointId') is not None:
134
+ self.endpoint_id = m.get('endpointId')
135
+ if m.get('name') is not None:
136
+ self.name = m.get('name')
137
+ if m.get('ipAddress') is not None:
138
+ self.ip_address = m.get('ipAddress')
139
+ if m.get('status') is not None:
140
+ self.status = m.get('status')
141
+ if m.get('service') is not None:
142
+ self.service = m.get('service')
143
+ if m.get('subnetId') is not None:
144
+ self.subnet_id = m.get('subnetId')
145
+ if m.get('description') is not None:
146
+ self.description = m.get('description')
147
+ if m.get('createTime') is not None:
148
+ self.create_time = m.get('createTime')
149
+ if m.get('productType') is not None:
150
+ self.product_type = m.get('productType')
151
+ if m.get('vpcId') is not None:
152
+ self.vpc_id = m.get('vpcId')
153
+ if m.get('tags') is not None:
154
+ self.tags = [TagModel().from_dict(i) for i in m.get('tags')]
155
+ return self
@@ -0,0 +1,142 @@
1
+ """
2
+ Endpoint information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class Endpoint(AbstractModel):
9
+ """
10
+ Endpoint
11
+ """
12
+
13
+ def __init__(
14
+ self,
15
+ endpoint_id=None,
16
+ name=None,
17
+ ip_address=None,
18
+ status=None,
19
+ service=None,
20
+ subnet_id=None,
21
+ description=None,
22
+ create_time=None,
23
+ vpc_id=None,
24
+ product_type=None,
25
+ ):
26
+ """
27
+ Initialize Endpoint instance.
28
+
29
+ :param endpoint_id: 服务网卡的ID
30
+ :type endpoint_id: str (optional)
31
+
32
+ :param name: 服务网卡的名称
33
+ :type name: str (optional)
34
+
35
+ :param ip_address: 服务网卡IP
36
+ :type ip_address: str (optional)
37
+
38
+ :param status: 服务网卡状态,取值:available/unavailable,分别表示:可挂载/不可挂载
39
+ :type status: str (optional)
40
+
41
+ :param service: 服务唯一域名
42
+ :type service: str (optional)
43
+
44
+ :param subnet_id: 子网ID
45
+ :type subnet_id: str (optional)
46
+
47
+ :param description: 描述
48
+ :type description: str (optional)
49
+
50
+ :param create_time: 创建时间
51
+ :type create_time: str (optional)
52
+
53
+ :param vpc_id: VPC的ID
54
+ :type vpc_id: str (optional)
55
+
56
+ :param product_type: 付费类型
57
+ :type product_type: str (optional)
58
+ """
59
+ super().__init__()
60
+ self.endpoint_id = endpoint_id
61
+ self.name = name
62
+ self.ip_address = ip_address
63
+ self.status = status
64
+ self.service = service
65
+ self.subnet_id = subnet_id
66
+ self.description = description
67
+ self.create_time = create_time
68
+ self.vpc_id = vpc_id
69
+ self.product_type = product_type
70
+
71
+ def to_dict(self):
72
+ """
73
+ Convert the model instance to a dictionary representation.
74
+
75
+ Nested model objects are recursively converted to dictionaries.
76
+
77
+ :return: Dictionary representation of the model
78
+ :rtype: dict
79
+ """
80
+ _map = super().to_dict()
81
+ if _map is not None:
82
+ return _map
83
+ result = dict()
84
+ if self.endpoint_id is not None:
85
+ result['endpointId'] = self.endpoint_id
86
+ if self.name is not None:
87
+ result['name'] = self.name
88
+ if self.ip_address is not None:
89
+ result['ipAddress'] = self.ip_address
90
+ if self.status is not None:
91
+ result['status'] = self.status
92
+ if self.service is not None:
93
+ result['service'] = self.service
94
+ if self.subnet_id is not None:
95
+ result['subnetId'] = self.subnet_id
96
+ if self.description is not None:
97
+ result['description'] = self.description
98
+ if self.create_time is not None:
99
+ result['createTime'] = self.create_time
100
+ if self.vpc_id is not None:
101
+ result['vpcId'] = self.vpc_id
102
+ if self.product_type is not None:
103
+ result['productType'] = self.product_type
104
+ return result
105
+
106
+ def from_dict(self, m):
107
+ """
108
+ Populate the model instance from a dictionary.
109
+
110
+ Nested dictionaries are recursively converted to model objects.
111
+
112
+ :param m: Dictionary containing model data
113
+ :type m: dict
114
+
115
+ :return: Self reference for method chaining
116
+ :rtype: Endpoint
117
+
118
+ :raises TypeError: If input is not a dictionary type
119
+ :raises ValueError: If nested model conversion fails
120
+ """
121
+ m = m or dict()
122
+ if m.get('endpointId') is not None:
123
+ self.endpoint_id = m.get('endpointId')
124
+ if m.get('name') is not None:
125
+ self.name = m.get('name')
126
+ if m.get('ipAddress') is not None:
127
+ self.ip_address = m.get('ipAddress')
128
+ if m.get('status') is not None:
129
+ self.status = m.get('status')
130
+ if m.get('service') is not None:
131
+ self.service = m.get('service')
132
+ if m.get('subnetId') is not None:
133
+ self.subnet_id = m.get('subnetId')
134
+ if m.get('description') is not None:
135
+ self.description = m.get('description')
136
+ if m.get('createTime') is not None:
137
+ self.create_time = m.get('createTime')
138
+ if m.get('vpcId') is not None:
139
+ self.vpc_id = m.get('vpcId')
140
+ if m.get('productType') is not None:
141
+ self.product_type = m.get('productType')
142
+ return self
@@ -0,0 +1,102 @@
1
+ """
2
+ Request entity for ListSnicRequest information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class ListSnicRequest(AbstractModel):
9
+ """
10
+ Request entity for ListSnicRequest operation.
11
+
12
+ This class encapsulates all parameters for the API request.
13
+ """
14
+
15
+ def __init__(
16
+ self, vpc_id, name=None, ip_address=None, status=None, subnet_id=None, service=None, marker=None, max_keys=None
17
+ ):
18
+ """
19
+ Initialize ListSnicRequest request entity.
20
+
21
+ :param vpc_id: vpc_id parameter
22
+ :type vpc_id: str (required)
23
+
24
+ :param name: name parameter
25
+ :type name: str (optional)
26
+
27
+ :param ip_address: ip_address parameter
28
+ :type ip_address: str (optional)
29
+
30
+ :param status: status parameter
31
+ :type status: str (optional)
32
+
33
+ :param subnet_id: subnet_id parameter
34
+ :type subnet_id: str (optional)
35
+
36
+ :param service: service parameter
37
+ :type service: str (optional)
38
+
39
+ :param marker: marker parameter
40
+ :type marker: str (optional)
41
+
42
+ :param max_keys: max_keys parameter
43
+ :type max_keys: int (optional)
44
+ """
45
+ super().__init__()
46
+ self.vpc_id = vpc_id
47
+ self.name = name
48
+ self.ip_address = ip_address
49
+ self.status = status
50
+ self.subnet_id = subnet_id
51
+ self.service = service
52
+ self.marker = marker
53
+ self.max_keys = max_keys
54
+
55
+ def to_dict(self):
56
+ """
57
+ Convert the request entity to a dictionary representation.
58
+
59
+ Nested model objects are recursively converted to dictionaries.
60
+
61
+ :return: Dictionary representation of the request
62
+ :rtype: dict
63
+ """
64
+ _map = super().to_dict()
65
+ if _map is not None:
66
+ return _map
67
+ result = dict()
68
+ return result
69
+
70
+ def from_dict(self, m):
71
+ """
72
+ Populate the request entity from a dictionary.
73
+
74
+ Nested dictionaries are recursively converted to model objects.
75
+
76
+ :param m: Dictionary containing request data
77
+ :type m: dict
78
+
79
+ :return: Self reference for method chaining
80
+ :rtype: ListSnicRequest
81
+
82
+ :raises TypeError: If input is not a dictionary or field type mismatch
83
+ :raises ValueError: If nested model conversion fails
84
+ """
85
+ m = m or dict()
86
+ if m.get('vpcId') is not None:
87
+ self.vpc_id = m.get('vpcId')
88
+ if m.get('name') is not None:
89
+ self.name = m.get('name')
90
+ if m.get('ipAddress') is not None:
91
+ self.ip_address = m.get('ipAddress')
92
+ if m.get('status') is not None:
93
+ self.status = m.get('status')
94
+ if m.get('subnetId') is not None:
95
+ self.subnet_id = m.get('subnetId')
96
+ if m.get('service') is not None:
97
+ self.service = m.get('service')
98
+ if m.get('marker') is not None:
99
+ self.marker = m.get('marker')
100
+ if m.get('maxKeys') is not None:
101
+ self.max_keys = m.get('maxKeys')
102
+ return self
@@ -0,0 +1,94 @@
1
+ """
2
+ Request entity for ListSnicResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+ from baiducloud_python_sdk_snic.models.endpoint import Endpoint
7
+
8
+
9
+ class ListSnicResponse(BceResponse):
10
+ """
11
+ ListSnicResponse
12
+ """
13
+
14
+ def __init__(self, marker=None, is_truncated=None, next_marker=None, max_keys=None, endpoints=None):
15
+ """
16
+ Initialize ListSnicResponse response.
17
+
18
+ :param marker: 标记查询的起始位置
19
+ :type marker: str (optional)
20
+
21
+ :param is_truncated: true表示后面还有数据,false表示已经是最后一页
22
+ :type is_truncated: bool (optional)
23
+
24
+ :param next_marker: 获取下一页所需要传递的marker值。当isTruncated为false时,该域不出现
25
+ :type next_marker: str (optional)
26
+
27
+ :param max_keys: 每页包含的最大数量
28
+ :type max_keys: int (optional)
29
+
30
+ :param endpoints: 服务网卡列表
31
+ :type endpoints: List[Endpoint] (optional)
32
+ """
33
+ super().__init__()
34
+ self.marker = marker
35
+ self.is_truncated = is_truncated
36
+ self.next_marker = next_marker
37
+ self.max_keys = max_keys
38
+ self.endpoints = endpoints
39
+
40
+ def to_dict(self):
41
+ """
42
+ Convert the response instance to a dictionary representation.
43
+
44
+ Includes metadata from the parent BceResponse class.
45
+ Nested model objects are recursively converted to dictionaries.
46
+
47
+ :return: Dictionary representation of the response
48
+ :rtype: dict
49
+ """
50
+ _map = super().to_dict()
51
+ if _map is not None:
52
+ return _map
53
+ result = dict()
54
+ if self.metadata is not None:
55
+ result['metadata'] = dict(self.metadata)
56
+ if self.marker is not None:
57
+ result['marker'] = self.marker
58
+ if self.is_truncated is not None:
59
+ result['isTruncated'] = self.is_truncated
60
+ if self.next_marker is not None:
61
+ result['nextMarker'] = self.next_marker
62
+ if self.max_keys is not None:
63
+ result['maxKeys'] = self.max_keys
64
+ if self.endpoints is not None:
65
+ result['endpoints'] = [i.to_dict() for i in self.endpoints]
66
+ return result
67
+
68
+ def from_dict(self, m):
69
+ """
70
+ Populate the response instance from a dictionary.
71
+
72
+ Nested dictionaries are recursively converted to model objects.
73
+
74
+ :param m: Dictionary containing response data
75
+ :type m: dict
76
+
77
+ :return: Self reference for method chaining
78
+ :rtype: ListSnicResponse
79
+
80
+ :raises TypeError: If input is not a dictionary or field type mismatch
81
+ :raises ValueError: If nested model conversion fails
82
+ """
83
+ m = m or dict()
84
+ if m.get('marker') is not None:
85
+ self.marker = m.get('marker')
86
+ if m.get('isTruncated') is not None:
87
+ self.is_truncated = m.get('isTruncated')
88
+ if m.get('nextMarker') is not None:
89
+ self.next_marker = m.get('nextMarker')
90
+ if m.get('maxKeys') is not None:
91
+ self.max_keys = m.get('maxKeys')
92
+ if m.get('endpoints') is not None:
93
+ self.endpoints = [Endpoint().from_dict(i) for i in m.get('endpoints')]
94
+ return self
@@ -0,0 +1,61 @@
1
+ """
2
+ Request entity for QueryAvailablePublicServicesResponse information.
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.bce_response import BceResponse
6
+
7
+
8
+ class QueryAvailablePublicServicesResponse(BceResponse):
9
+ """
10
+ QueryAvailablePublicServicesResponse
11
+ """
12
+
13
+ def __init__(self, services=None):
14
+ """
15
+ Initialize QueryAvailablePublicServicesResponse response.
16
+
17
+ :param services: 公共服务的域名列表
18
+ :type services: List[str] (optional)
19
+ """
20
+ super().__init__()
21
+ self.services = services
22
+
23
+ def to_dict(self):
24
+ """
25
+ Convert the response instance to a dictionary representation.
26
+
27
+ Includes metadata from the parent BceResponse class.
28
+ Nested model objects are recursively converted to dictionaries.
29
+
30
+ :return: Dictionary representation of the response
31
+ :rtype: dict
32
+ """
33
+ _map = super().to_dict()
34
+ if _map is not None:
35
+ return _map
36
+ result = dict()
37
+ if self.metadata is not None:
38
+ result['metadata'] = dict(self.metadata)
39
+ if self.services is not None:
40
+ result['services'] = self.services
41
+ return result
42
+
43
+ def from_dict(self, m):
44
+ """
45
+ Populate the response instance from a dictionary.
46
+
47
+ Nested dictionaries are recursively converted to model objects.
48
+
49
+ :param m: Dictionary containing response data
50
+ :type m: dict
51
+
52
+ :return: Self reference for method chaining
53
+ :rtype: QueryAvailablePublicServicesResponse
54
+
55
+ :raises TypeError: If input is not a dictionary or field type mismatch
56
+ :raises ValueError: If nested model conversion fails
57
+ """
58
+ m = m or dict()
59
+ if m.get('services') is not None:
60
+ self.services = m.get('services')
61
+ return self
@@ -0,0 +1,66 @@
1
+ """
2
+ Reservation information
3
+ """
4
+
5
+ from baiducloud_python_sdk_core.abstract_model import AbstractModel
6
+
7
+
8
+ class Reservation(AbstractModel):
9
+ """
10
+ Reservation
11
+ """
12
+
13
+ def __init__(self, reservation_length=None, reservation_time_unit=None):
14
+ """
15
+ Initialize Reservation instance.
16
+
17
+ :param reservation_length: 时长,[1,2,3,4,5,6,7,8,9,12,24,36]
18
+ :type reservation_length: int (optional)
19
+
20
+ :param reservation_time_unit: 时间单位,month,当前仅支持按月
21
+ :type reservation_time_unit: str (optional)
22
+ """
23
+ super().__init__()
24
+ self.reservation_length = reservation_length
25
+ self.reservation_time_unit = reservation_time_unit
26
+
27
+ def to_dict(self):
28
+ """
29
+ Convert the model instance to a dictionary representation.
30
+
31
+ Nested model objects are recursively converted to dictionaries.
32
+
33
+ :return: Dictionary representation of the model
34
+ :rtype: dict
35
+ """
36
+ _map = super().to_dict()
37
+ if _map is not None:
38
+ return _map
39
+ result = dict()
40
+ if self.reservation_length is not None:
41
+ result['reservationLength'] = self.reservation_length
42
+ if self.reservation_time_unit is not None:
43
+ result['reservationTimeUnit'] = self.reservation_time_unit
44
+ return result
45
+
46
+ def from_dict(self, m):
47
+ """
48
+ Populate the model instance from a dictionary.
49
+
50
+ Nested dictionaries are recursively converted to model objects.
51
+
52
+ :param m: Dictionary containing model data
53
+ :type m: dict
54
+
55
+ :return: Self reference for method chaining
56
+ :rtype: Reservation
57
+
58
+ :raises TypeError: If input is not a dictionary type
59
+ :raises ValueError: If nested model conversion fails
60
+ """
61
+ m = m or dict()
62
+ if m.get('reservationLength') is not None:
63
+ self.reservation_length = m.get('reservationLength')
64
+ if m.get('reservationTimeUnit') is not None:
65
+ self.reservation_time_unit = m.get('reservationTimeUnit')
66
+ return self