本文整理匯總了Python中openstack.utils.HandlePycurl.deleteData方法的典型用法代碼示例。如果您正苦於以下問題:Python HandlePycurl.deleteData方法的具體用法?Python HandlePycurl.deleteData怎麽用?Python HandlePycurl.deleteData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類openstack.utils.HandlePycurl
的用法示例。
在下文中一共展示了HandlePycurl.deleteData方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: v2_deleteRole
# 需要導入模塊: from openstack.utils import HandlePycurl [as 別名]
# 或者: from openstack.utils.HandlePycurl import deleteData [as 別名]
def v2_deleteRole(request):
""" Deletes a role.
Method:DELETE
URI:/v2.0/OS-KSADM/roles/{roleId}
"""
req_params = {
"token_id": request.POST.get("token_id"),
"remotehost": request.POST.get("remotehost"),
"role_id": request.POST.get("role_id")
}
head = [
"X-Auth-Token: %s" % req_params.get("token_id"),
]
parms = {
'servername': req_params.get("remotehost"),
'port': 35357,
'uri': '/v2.0/OS-KSADM/roles/%(roleId)s' % {
"roleId": req_params.get("role_id")
}
}
url = 'http://%(servername)s:%(port)d%(uri)s' % parms
hpc = HandlePycurl()
context = hpc.deleteData(hpc.initCurl(), url, head)
return HttpResponse(context or "delete successfully")
示例2: v2_deleteTenant
# 需要導入模塊: from openstack.utils import HandlePycurl [as 別名]
# 或者: from openstack.utils.HandlePycurl import deleteData [as 別名]
def v2_deleteTenant(request):
""" Deletes a tenant.
Method:DELETE
URI:/v2.0/tenants/{tenantId}
"""
req_params = {
"token_id": request.GET.get("token_id"),
"remotehost": request.GET.get("remotehost"),
"tenantId": request.GET.get("tenantId") ,
}
head = [
"X-Auth-Token: %s" % req_params.get("token_id"),
]
parms = {
'servername': req_params.get("remotehost"),
'port': 35357,
'uri': '/v2.0/tenants/%(tenantId)s' % {
"tenantId": req_params.get("tenantId")
}
}
url = 'http://%(servername)s:%(port)d%(uri)s' % parms
hpc = HandlePycurl()
context = hpc.deleteData(hpc.initCurl(), url, head)
return HttpResponse(context or "delete seccussful")
示例3: v2_deleteTenantRoleFromUser
# 需要導入模塊: from openstack.utils import HandlePycurl [as 別名]
# 或者: from openstack.utils.HandlePycurl import deleteData [as 別名]
def v2_deleteTenantRoleFromUser(request):
""" Deletes a specified role from a user on a tenant.
Method:DELETE
URI:/v2.0/tenants/{tenantId}/users/{userId}/roles/OS-KSADM/{roleId}
"""
req_params = {
"token_id": request.POST.get("token_id"),
"remotehost": request.POST.get("remotehost"),
"tenantId": request.POST.get("tenantId") ,
"userId": request.POST.get("userId"),
"roleId": request.POST.get("roleId"),
}
head = [
"X-Auth-Token: %s" % req_params.get("token_id"),
]
parms = {
'servername': req_params.get("remotehost"),
'port': 35357,
'uri': '/v2.0/tenants/%(tenantId)s/users/%(userId)s/roles/OS-KSADM/%(roleId)s' % {
"tenantId": req_params.get("tenantId"),
"userId": req_params.get("userId"),
"roleId": req_params.get("roleId")
}
}
url = 'http://%(servername)s:%(port)d%(uri)s' % parms
hpc = HandlePycurl()
context = hpc.deleteData(hpc.initCurl(), url, head)
return HttpResponse(context or "delete successfully")
示例4: v3_revokeProjectUserRole
# 需要導入模塊: from openstack.utils import HandlePycurl [as 別名]
# 或者: from openstack.utils.HandlePycurl import deleteData [as 別名]
def v3_revokeProjectUserRole(request):
""" Revokes a role from a project user.
Method:DELETE
URI:/v3/projects/{project_id}/users/{user_id}/roles/{role_id}
"""
req_params = {
"remotehost": request.POST.get("remotehost"),
"token_id": request.POST.get("token_id"),
"project_id": request.POST.get("project_id"),
"user_id": request.POST.get("user_id"),
"role_id": request.POST.get("role_id"),
}
data = dict()
head = [
"X-Auth-Token: %s" % req_params.get("token_id"),
]
parms = {
'servername': req_params.get("remotehost"),
'port': 5000,
'uri': '/v3/projects/%(project_id)s/users/%(user_id)s/roles/%(role_id)s' % {
"project_id": req_params.get('project_id'),
"user_id": req_params.get('user_id'),
"role_id": req_params.get('role_id')
}
}
url = 'http://%(servername)s:%(port)d%(uri)s' % parms
hpc = HandlePycurl()
context = hpc.deleteData(hpc.initCurl(), url, head)
return HttpResponse(context or 'delete successfully')
示例5: v2_deleteImagesTags
# 需要導入模塊: from openstack.utils import HandlePycurl [as 別名]
# 或者: from openstack.utils.HandlePycurl import deleteData [as 別名]
def v2_deleteImagesTags(request):
""" Deletes a specified tag from a specified image. (Since Image API v2.0.)
Method:DELETE
URI:/v2/images/{image_id}/tags/{tag}
"""
req_params = {
"token_id": request.POST.get("token_id"),
"remotehost": request.POST.get("remotehost"),
"image_id": request.POST.get("image_id"),
"tag_name": request.POST.get("tag_name")
}
head = [
"X-Auth-Token: %s" % req_params.get("token_id"),
]
parms = {
'servername': req_params.get("remotehost"),
'port': 9292,
'uri': '/v2/images/%(image_id)s/tags/%(tag)s' % {
"image_id": req_params.get("image_id"),
"tag_name": req_params.get("tag_name")
}
}
url = 'http://%(servername)s:%(port)d%(uri)s' % parms
hpc = HandlePycurl()
context = hpc.deleteData(hpc.initCurl(), url, head)
return HttpResponse(context)
示例6: v2_deleteService
# 需要導入模塊: from openstack.utils import HandlePycurl [as 別名]
# 或者: from openstack.utils.HandlePycurl import deleteData [as 別名]
def v2_deleteService(request):
""" Deletes a service.
Method:DELETE
URI:/v2.0/OS-KSADM/services/{serviceId}
"""
token_id = 'ce894ef7c23d462fab19d8ace0b34e73'
head = [
"X-Auth-Token: %s" % token_id,
]
parms = {
'servername': '192.168.30.127',
'port': 35357,
'uri': '/v2.0/OS-KSADM/services/%(serviceId)s' % {
"serviceId": "14634021651843109aa9342cc9c924f1"
}
}
url = 'http://%(servername)s:%(port)d%(uri)s' % parms
hpc = HandlePycurl()
context = hpc.deleteData(hpc.initCurl(), url, head)
return HttpResponse(context)
示例7: v2_deleteMeteringsMeteringLabels
# 需要導入模塊: from openstack.utils import HandlePycurl [as 別名]
# 或者: from openstack.utils.HandlePycurl import deleteData [as 別名]
def v2_deleteMeteringsMeteringLabels(request):
""" Deletes a l3 metering label.
Method:DELETE
URI:/v2.0/metering/metering-labels/{metering_label_id}
"""
token_id = '2c769e9c9eea47c8bbd2c31712c51ba1'
head = [
"X-Auth-Token: %s"%token_id,
]
parms = {
'servername':'192.168.30.127',
'port':9696,
'uri':'/v2.0/metering/metering-labels/%(metering_label_id)s'%{
"metering_label_id":"d185615d-821f-4d91-bd60-b9817f3d8540"
}
}
url = 'http://%(servername)s:%(port)d%(uri)s'%parms
hpc = HandlePycurl()
context = hpc.deleteData(hpc.initCurl(),url,head)
return HttpResponse(context)
示例8: v2_deleteMeteringsMeteringLabelsRules
# 需要導入模塊: from openstack.utils import HandlePycurl [as 別名]
# 或者: from openstack.utils.HandlePycurl import deleteData [as 別名]
def v2_deleteMeteringsMeteringLabelsRules(request):
""" Deletes a specified l3 metering label rule.
Method:DELETE
URI:/v2.0/metering/metering-label-rules/{metering-label-rule-id}
"""
token_id = '2c769e9c9eea47c8bbd2c31712c51ba1'
head = [
"X-Auth-Token: %s"%token_id,
]
parms = {
'servername':'192.168.30.127',
'port':9696,
'uri':'/v2.0/metering/metering-label-rules/%(metering_label_rule_id)s'%{
"metering_label_rule_id":"ca0d86f2-fbe8-4829-9cc1-847925677878"
}
}
url = 'http://%(servername)s:%(port)d%(uri)s'%parms
hpc = HandlePycurl()
context = hpc.deleteData(hpc.initCurl(),url,head)
return HttpResponse(context)
示例9: v2_deleteImagesMembers
# 需要導入模塊: from openstack.utils import HandlePycurl [as 別名]
# 或者: from openstack.utils.HandlePycurl import deleteData [as 別名]
def v2_deleteImagesMembers(request):
""" Deletes a specified tenant ID from the member list of the specified image. (Since Image API v2.1.)
Method: DELETE
URI:/v2/images/{image_id}/members/{member_id}
"""
token_id = 'ecbf0a4e12ef4649adf7a8f5f39718b7'
head = [
"X-Auth-Token: %s" % token_id,
]
parms = {
'servername': '192.168.30.127',
'port': 9292,
'uri': '/v2.0/images/%(image_id)s/members/%(member_id)s' % {
"image_id": "33139f93-b2d0-4b4b-99c3-f40778d624c9",
"member_id": "aaaaaaaaaaaa-a------------dd-----ads--f-s-d-f-a"
}
}
url = 'http://%(servername)s:%(port)d%(uri)s' % parms
hpc = HandlePycurl()
context = hpc.deleteData(hpc.initCurl(), url, head)
return HttpResponse(context)