[英]Unable to find Rest api reference for deleting azure vm endpoint
我正在嘗試找到用於刪除配置的azure vm端點的其余api參考。 我通過以下鏈接獲得了更新/創建端點的其余api引用,但無法獲取刪除enpoint的引用。 任何人都試圖使用rest api刪除端點。 如果是這樣,請分享如何使用rest api刪除azure中vm的端點。
http://msdn.microsoft.com/en-us/library/jj157187.aspx - 更新角色
提前致謝。
我認為沒有專門用於刪除端點的REST API操作。 您可以做的是首先使用Get Role
操作Get Role
VM配置。 你會得到一個XML。 接下來,您可以從此XML中刪除要刪除的端點設置,並再次調用“ Update Role
以保留該設置。
您可以查看Azure Ruby SDK:
def delete_endpoint(vm_name, cloud_service_name, endpoint_name)
vm = get_virtual_machine(vm_name, cloud_service_name)
if vm
path = "/services/hostedservices/#{vm.cloud_service_name}/deployments/#{vm.deployment_name}/roles/#{vm_name}"
endpoints = vm.tcp_endpoints + vm.udp_endpoints
endpoints.delete_if { |ep| endpoint_name.downcase == ep[:name].downcase }
body = Serialization.update_role_to_xml(endpoints, vm)
request = BaseManagement::ManagementHttpRequest.new(:put, path, body)
Azure::Loggerx.info "Deleting virtual machine endpoint #{endpoint_name} ..."
request.call
else
Azure::Loggerx.error "Cannot find virtual machine \"#{vm_name}\" under cloud service \"#{cloud_service_name}\"."
end
end
不確定微軟的意思是“角色”......
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.