问题描述
- 各位大神好!! 这个方法为什么不行啊??
-
def delete_role_instances(self, service_name, deployment_name,
role_instance_names):
'''
Reinstalls the operating system on instances of web roles or worker
roles and initializes the storage resources that are used by them. If
you do not want to initialize storage resources, you can use
reimage_role_instance.service_name: Name of the hosted service. deployment_name: The name of the deployment. role_instance_names: List of role instance names.
各位大神好!!
这个方法为什么不行啊??
解决方案
Python刚接触,不熟,只看懂了你注释了一半
解决方案二:
您好,
我想知道您是怎么调用该方法的?据我所知,您可能需要先创建一个证书,并上传之Azure上,建议您参考该官方文档:
http://www.windowsazure.cn/documentation/articles/cloud-services-python-how-to-use-service-management/#Connect
同时,您可以参考该代码:
from azure import *
from azure.servicemanagement import *
subscription_id = '***'
certificate_path = '***.cer'
service_name='cloudservice'
deployment_name='test'
role_instance_names='testinstance1'
sms = ServiceManagementService(subscription_id, certificate_path)
sms.delete_role_instances(service_name,deployment_name,role_instance_names);
同时建议您参考该REST 方法,https://msdn.microsoft.com/zh-cn/library/azure/dn469418.aspx
Python的SDK将该REST方法封装在类库servicemanagement 中,您也可以自己通过httprequest去调用该服务。
希望对您有所帮助。您也可以将您的错误信息和代码分享下,我们可以帮您更好的去解决问题。
Regards,
Will
如果您想进一步了解Windows Azure, Windows Azure 官网欢迎您的访问
时间: 2024-09-23 19:46:22