Skip to content
This repository was archived by the owner on Nov 13, 2023. It is now read-only.

Commit 829712e

Browse files
committed
release python sdk 1.0.27
1 parent f36f46d commit 829712e

File tree

10 files changed

+306
-90
lines changed

10 files changed

+306
-90
lines changed

PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 1.1
22
Name: huaweicloud-sdk-python
3-
Version: 1.0.26
3+
Version: 1.0.27
44
Summary: An SDK for building applications to work with OpenStack
55
Home-page: https://github.com/huaweicloud/huaweicloud-sdk-python
66
Author: "HuaweiCloud SDK"

README.rst

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
================
2-
Attention Please
3-
================
4-
5-
Current SDK huaweicloud-sdk-python will be deprecated and new version of SDK is recommended. Please look at https://github.com/huaweicloud/huaweicloud-sdk-python-v3 to learn more.
6-
7-
================
8-
温馨提示
9-
================
10-
11-
华为云已推出新版本的 SDK 供广大用户使用,当前版本后续将不推荐使用,请移步仓库 https://github.com/huaweicloud/huaweicloud-sdk-python-v3 了解更多。
12-
131
================
142
Python SDK
153
================
@@ -59,4 +47,4 @@ The following services' SDK are included.
5947

6048
- RTS
6149

62-
- FunctionGraph
50+
- FunctionGraph

examples/ecs/cloudserver.py

Lines changed: 62 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -18,68 +18,71 @@
1818
# create server
1919
def create_server():
2020
data = {
21-
"availability_zone": "az1.dc1",
22-
"name": "test-name",
23-
"imageRef": "22ecd57e-aab4-4251-9d13-38058659d879",
24-
"root_volume": {
25-
"volumetype": "SATA"
26-
},
27-
"data_volumes": [
21+
"server":
2822
{
29-
"volumetype": "SSD",
30-
"size": 50
31-
},
32-
{
33-
"volumetype": "SSD",
34-
"size": 50,
35-
"multiattach": "false",
36-
"hw:passthrough": "false"
37-
}
38-
],
39-
"isAutoRename": "true",
40-
"flavorRef": "s1.medium",
41-
"personality": [
42-
{
43-
"path": "/etc/test.txt",
44-
"contents":"ICAgICAgDQoiQmFjaA=="
45-
}
46-
],
47-
"security_groups": [
48-
{
49-
"id": "3cd0dc61-3a84-43de-9741-394fce012f38"
50-
}
51-
],
52-
"vpcid": "515231d1-f0d9-4acf-a549-c79f90ef7c4e",
53-
"nics": [
54-
{
55-
"subnet_id": "0cf0ef67-9504-42f8-bf33-a0334792b2f6"
56-
}
57-
],
58-
"publicip": {
59-
"eip": {
60-
"iptype": "5_bgp",
61-
"bandwidth": {
62-
"size": 10,
63-
"sharetype": "PER"
23+
"availability_zone": "az1.dc1",
24+
"name": "test-name",
25+
"imageRef": "22ecd57e-aab4-4251-9d13-38058659d879",
26+
"root_volume": {
27+
"volumetype": "SATA"
28+
},
29+
"data_volumes": [
30+
{
31+
"volumetype": "SSD",
32+
"size": 50
33+
},
34+
{
35+
"volumetype": "SSD",
36+
"size": 50,
37+
"multiattach": "false",
38+
"hw:passthrough": "false"
39+
}
40+
],
41+
"isAutoRename": "true",
42+
"flavorRef": "s1.medium",
43+
"personality": [
44+
{
45+
"path": "/etc/test.txt",
46+
"contents": "ICAgICAgDQoiQmFjaA=="
47+
}
48+
],
49+
"security_groups": [
50+
{
51+
"id": "3cd0dc61-3a84-43de-9741-394fce012f38"
52+
}
53+
],
54+
"vpcid": "515231d1-f0d9-4acf-a549-c79f90ef7c4e",
55+
"nics": [
56+
{
57+
"subnet_id": "0cf0ef67-9504-42f8-bf33-a0334792b2f6"
58+
}
59+
],
60+
"publicip": {
61+
"eip": {
62+
"iptype": "5_bgp",
63+
"bandwidth": {
64+
"size": 10,
65+
"sharetype": "PER"
66+
}
67+
}
68+
},
69+
"key_name": "KeyPair-ccad",
70+
"count": 1,
71+
"metadata": {
72+
"ss": "ss"
73+
},
74+
"extendparam": {
75+
"chargingMode": "prePaid",
76+
"periodType": "month",
77+
"periodNum": 1,
78+
"isAutoRenew": "true",
79+
"isAutoPay": "true",
80+
"regionID": "southchina"
81+
},
82+
"os:scheduler_hints": {
83+
"group": "ae089094-087b-4c39-ba98-f1862d5e45b1"
6484
}
6585
}
66-
},
67-
"key_name": "KeyPair-ccad",
68-
"count": 1,
69-
"metadata": {
70-
"ss": "ss"
71-
},
72-
"extendparam": {
73-
"chargingMode": "prePaid",
74-
"periodType": "month",
75-
"periodNum": 1,
76-
"isAutoRenew": "true",
77-
"isAutoPay": "true",
78-
"regionID": "southchina"
79-
},
80-
"os:scheduler_hints": {
81-
"group": "ae089094-087b-4c39-ba98-f1862d5e45b1"
82-
}
8386
}
8487
server = conn.ecs.create_server_ext(**data)
8588
print(server)

examples/ecs/create_one_or_more_servers.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,24 @@ def create_two_servers_one_time():
3030
user_data = utils.b64encode(user_date_org)
3131

3232
data = {
33-
"availability_zone": "az1.dc1",
34-
"name": "test-sdk-for-Linux-userdata",
35-
"imageRef": "af60e0d5-6952-4f3d-b0ed-31bb19d4a692",
36-
"flavorRef": "c2.large",
37-
"vpcid": "0f22416a-53aa-4f45-b351-7807118c680b",
38-
"user_data": user_data,
39-
"nics": [
33+
"server":
4034
{
41-
"subnet_id": "d090d69f-2109-4228-a941-a6067723744a"
35+
"availability_zone": "az1.dc1",
36+
"name": "test-sdk-for-Linux-userdata",
37+
"imageRef": "af60e0d5-6952-4f3d-b0ed-31bb19d4a692",
38+
"flavorRef": "c2.large",
39+
"vpcid": "0f22416a-53aa-4f45-b351-7807118c680b",
40+
"user_data": user_data,
41+
"nics": [
42+
{
43+
"subnet_id": "d090d69f-2109-4228-a941-a6067723744a"
44+
}
45+
],
46+
"root_volume": {
47+
"volumetype": "SATA"
48+
},
49+
"count": 2
4250
}
43-
],
44-
"root_volume": {
45-
"volumetype": "SATA"
46-
},
47-
"count": 2
4851
}
4952

5053
ff = conn.ecs.create_server(**data)

examples/ecs/create_server_with_password.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def create_server_with_user_data():
3232
"flavorRef": "s1.medium",
3333
"security_groups": [
3434
{
35-
"name": "3cd0dc61-3a84-43de-9741-394fce012f38"
35+
"id": "3cd0dc61-3a84-43de-9741-394fce012f38"
3636
}
3737
],
3838
"networks": [
@@ -61,7 +61,7 @@ def create_windows_server_with_adminpass():
6161
"flavorRef": "s1.xlarge",
6262
"security_groups": [
6363
{
64-
"name": "db06a582-b8f8-42d6-bfaa-67995528dddb"
64+
"id": "db06a582-b8f8-42d6-bfaa-67995528dddb"
6565
}
6666
],
6767
"networks": [

examples/ecs/v1/cloudserver.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,3 +324,4 @@ def reset_password(server_id):
324324
delete_server()
325325
batch_change_os()
326326
reset_password(server_id)
327+
get_vnc_address(server_id)

openstack/compute/v2/_proxy.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ def servers(self, details=True, paginated=True, **query):
456456
srv = _server.ServerDetail if details else _server.Server
457457
return self._list(srv, paginated=paginated, **query)
458458

459-
def servers_list(self, paginated=True, headers=None, **query):
459+
def servers_list(self, details=True, paginated=True, headers=None, **query):
460460
"""Retrieve a generator of servers
461461
462462
:param bool details: When set to ``False``
@@ -497,7 +497,8 @@ def servers_list(self, paginated=True, headers=None, **query):
497497
498498
:returns: A generator of server instances.
499499
"""
500-
return self._list_ext(_server.ServerListDetail, paginated=paginated, headers=headers, **query)
500+
srv = _server.ServerListDetail if details else _server.ServerList
501+
return self._list_ext(srv, paginated=paginated, headers=headers, **query)
501502

502503
def update_server(self, server, **attrs):
503504
"""Update a server

0 commit comments

Comments
 (0)