Openstack api调用heat-flavor

调用heat(flavor类型)

import requests
import json

headers={}
headers['Content-Type']='application/json'
headers['X-Auth-Token']=''

body={
    'files':{},
    'stack_name':'teststack',
    'template':{
        'heat_template_version':'2013-05-23',
        'resources':{
            'hello_world':{
                'type':'OS::Nova::Flavor',
                'properties':{
                    'name':'pvm_heat',
                    'disk':'20',
                    'ram':'1024',
                    'vcpus':'1',
                    'flavorid':'1111'
                    }
                }
            }
        }
    
}

a=requests.post(url='http://172.129.33.11:8004/v1/d01c7adaf105421d927f57f3fcac3e7c/stacks',data=json.dumps(body),headers=headers)
print(a.text)
print('stack创建成功')

 

posted @ 2021-12-15 15:57  衡衡酱  阅读(2)  评论(0)    收藏  举报
Live2D