@@ -40,6 +40,16 @@ class CollectionSchema(schema.ResponseSchema):
4040 }
4141
4242
43+ class FeatureModesSchema (schema .ResponseSchema ):
44+ """FeatureModes - 可以支持的模式类别"""
45+
46+ fields = {
47+ "MinimalCpuPlatform" : fields .List (fields .Str ()),
48+ "Name" : fields .Str (required = False , load_from = "Name" ),
49+ "RelatedToImageFeature" : fields .List (fields .Str ()),
50+ }
51+
52+
4353class DataDiskInfoSchema (schema .ResponseSchema ):
4454 """DataDiskInfo - 数据盘信息"""
4555
@@ -62,40 +72,29 @@ class BootDiskInfoSchema(schema.ResponseSchema):
6272 }
6373
6474
65- class FeatureModesSchema (schema .ResponseSchema ):
66- """FeatureModes - 可以支持的模式类别 """
75+ class MachineSizesSchema (schema .ResponseSchema ):
76+ """MachineSizes - GPU、CPU和内存信息 """
6777
6878 fields = {
69- "MinimalCpuPlatform" : fields .List (fields .Str ()),
70- "Name" : fields .Str (required = False , load_from = "Name" ),
71- "RelatedToImageFeature" : fields .List (fields .Str ()),
79+ "Collection" : fields .List (CollectionSchema ()),
80+ "Gpu" : fields .Int (required = False , load_from = "Gpu" ),
7281 }
7382
7483
75- class PerformanceSchema (schema .ResponseSchema ):
76- """Performance - GPU的性能指标 """
84+ class GraphicsMemorySchema (schema .ResponseSchema ):
85+ """GraphicsMemory - GPU的显存指标 """
7786
7887 fields = {
7988 "Rate" : fields .Int (required = False , load_from = "Rate" ),
80- "Value" : fields .Float (required = False , load_from = "Value" ),
81- }
82-
83-
84- class MachineSizesSchema (schema .ResponseSchema ):
85- """MachineSizes - GPU、CPU和内存信息"""
86-
87- fields = {
88- "Collection" : fields .List (CollectionSchema ()),
89- "Gpu" : fields .Int (required = False , load_from = "Gpu" ),
89+ "Value" : fields .Int (required = False , load_from = "Value" ),
9090 }
9191
9292
93- class DisksSchema (schema .ResponseSchema ):
94- """Disks - 磁盘信息 """
93+ class FeaturesSchema (schema .ResponseSchema ):
94+ """Features - 虚机可支持的特性 """
9595
9696 fields = {
97- "BootDisk" : fields .List (BootDiskInfoSchema ()),
98- "DataDisk" : fields .List (DataDiskInfoSchema ()),
97+ "Modes" : fields .List (FeatureModesSchema ()),
9998 "Name" : fields .Str (required = False , load_from = "Name" ),
10099 }
101100
@@ -110,20 +109,21 @@ class CpuPlatformsSchema(schema.ResponseSchema):
110109 }
111110
112111
113- class GraphicsMemorySchema (schema .ResponseSchema ):
114- """GraphicsMemory - GPU的显存指标 """
112+ class PerformanceSchema (schema .ResponseSchema ):
113+ """Performance - GPU的性能指标 """
115114
116115 fields = {
117116 "Rate" : fields .Int (required = False , load_from = "Rate" ),
118- "Value" : fields .Int (required = False , load_from = "Value" ),
117+ "Value" : fields .Float (required = False , load_from = "Value" ),
119118 }
120119
121120
122- class FeaturesSchema (schema .ResponseSchema ):
123- """Features - 虚机可支持的特性 """
121+ class DisksSchema (schema .ResponseSchema ):
122+ """Disks - 磁盘信息 """
124123
125124 fields = {
126- "Modes" : fields .List (FeatureModesSchema ()),
125+ "BootDisk" : fields .List (BootDiskInfoSchema ()),
126+ "DataDisk" : fields .List (DataDiskInfoSchema ()),
127127 "Name" : fields .Str (required = False , load_from = "Name" ),
128128 }
129129
@@ -223,23 +223,6 @@ class UDSetUDHostAttributeSchema(schema.ResponseSchema):
223223 }
224224
225225
226- class SpotAttributeSchema (schema .ResponseSchema ):
227- """SpotAttribute - 竞价实例属性"""
228-
229- fields = {
230- "RecycleTime" : fields .Int (required = False , load_from = "RecycleTime" ),
231- }
232-
233-
234- class UHostKeyPairSchema (schema .ResponseSchema ):
235- """UHostKeyPair - 主机密钥信息"""
236-
237- fields = {
238- "KeyPairId" : fields .Str (required = False , load_from = "KeyPairId" ),
239- "KeyPairState" : fields .Str (required = False , load_from = "KeyPairState" ),
240- }
241-
242-
243226class UHostIPSetSchema (schema .ResponseSchema ):
244227 """UHostIPSet - DescribeUHostInstance"""
245228
@@ -276,6 +259,23 @@ class UHostDiskSetSchema(schema.ResponseSchema):
276259 }
277260
278261
262+ class UHostKeyPairSchema (schema .ResponseSchema ):
263+ """UHostKeyPair - 主机密钥信息"""
264+
265+ fields = {
266+ "KeyPairId" : fields .Str (required = False , load_from = "KeyPairId" ),
267+ "KeyPairState" : fields .Str (required = False , load_from = "KeyPairState" ),
268+ }
269+
270+
271+ class SpotAttributeSchema (schema .ResponseSchema ):
272+ """SpotAttribute - 竞价实例属性"""
273+
274+ fields = {
275+ "RecycleTime" : fields .Int (required = False , load_from = "RecycleTime" ),
276+ }
277+
278+
279279class UHostInstanceSetSchema (schema .ResponseSchema ):
280280 """UHostInstanceSet - DescribeUHostInstance"""
281281
0 commit comments