File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
volcenginesdkexamples/volcenginesdkecs Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 1111
1212 # create an instance of the API class
1313 api_instance = volcenginesdkecs .ECSApi (volcenginesdkcore .ApiClient (configuration ))
14- resp = api_instance .describe_instances (
15- volcenginesdkecs .DescribeInstancesRequest (instance_ids = ["i-ybmqiil8u206g9yv" ]))
16-
14+ resp = api_instance .run_instances (
15+ volcenginesdkecs .RunInstancesRequest (
16+ instance_name = "insname" ,
17+ instance_type = "ecs.g1.large" ,
18+ zone_id = "cn-beijing-a" ,
19+ network_interfaces = [volcenginesdkecs .NetworkInterfaceForRunInstancesInput (
20+ subnet_id = "subnet-2d68bh73d858ozfekrm8fj" ,
21+ security_group_ids = ["sg-2b3dq7v0ha0w2dx0eg0nhljv" ],
22+ )],
23+ image_id = "image-ybvz29l3da4ox5h0m9" ,
24+ volumes = [volcenginesdkecs .VolumeForRunInstancesInput (
25+ volume_type = "ESSD" ,
26+ size = 40 ,
27+ )],
28+ key_pair_name = "vtable" ,
29+ instance_charge_type = "PostPaid"
30+ ))
1731 pprint (resp )
You can’t perform that action at this time.
0 commit comments