File tree Expand file tree Collapse file tree 8 files changed +1410
-16
lines changed
tests/unit/osclient/cce/v2 Expand file tree Collapse file tree 8 files changed +1410
-16
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may
3
+ # not use this file except in compliance with the License. You may obtain
4
+ # a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
+ # License for the specific language governing permissions and limitations
12
+ # under the License.
13
+ """
14
+ Create CCE Node Pool via OpenStack cloud layer
15
+ """
16
+ import openstack
17
+
18
+ openstack .enable_logging (True )
19
+ conn = openstack .connect (cloud = 'otc' )
20
+
21
+
22
+ pool = conn .create_cce_node_pool (
23
+ autoscaling_enabled = False ,
24
+ availability_zone = 'random' ,
25
+ billing_mode = 0 ,
26
+ cluster = 'bca73490-394c-11eb-8fe2-0255ac101123' ,
27
+ count = 0 ,
28
+ flavor = 's2.large.2' ,
29
+ initial_node_count = 0 ,
30
+ k8s_tags = {
31
+ "muh" : "kuh" },
32
+ ssh_key = 'sshkey-pub' ,
33
+ name = 'test' ,
34
+ os = 'CentOS 7.7' ,
35
+ root_volume_size = 40 ,
36
+ root_volume_type = 'SATA' ,
37
+ network_id = '25d24fc8-d019-4a34-9fff-0a09fde6a123' ,
38
+ tags = [
39
+ {
40
+ 'key' : 'hellokey1' ,
41
+ 'value' : 'hellovalue1'
42
+ }, {
43
+ 'key' : 'hellokey2' ,
44
+ 'value' : 'hellovalue2'
45
+ }],
46
+ data_volumes = [
47
+ {
48
+ 'volumetype' : 'SATA' ,
49
+ 'size' : 120 ,
50
+ }, {
51
+ 'volumetype' : 'SATA' ,
52
+ 'size' : 100 ,
53
+ 'encrypted' : True ,
54
+ 'cmk_id' : '5b16304e-aa0f-488e-9c9e-7d2402def123'
55
+ }]
56
+ )
57
+ print (pool )
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may
3
+ # not use this file except in compliance with the License. You may obtain
4
+ # a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11
+ # License for the specific language governing permissions and limitations
12
+ # under the License.
13
+ """
14
+ Delete CCE node pool in cloud layer
15
+ """
16
+ import openstack
17
+
18
+ openstack .enable_logging (True )
19
+ conn = openstack .connect (cloud = 'otc' )
20
+
21
+
22
+ cluster = 'bca73490-394c-11eb-8fe2-0255ac101123'
23
+ pool = '58d24fde-4042-11eb-8fea-0255ac101123'
24
+ conn .delete_cce_node_pool (
25
+ cluster = cluster ,
26
+ node_pool = pool )
You can’t perform that action at this time.
0 commit comments