本文整理匯總了Golang中github.com/rackspace/gophercloud.ServiceClient.Delete方法的典型用法代碼示例。如果您正苦於以下問題:Golang ServiceClient.Delete方法的具體用法?Golang ServiceClient.Delete怎麽用?Golang ServiceClient.Delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/rackspace/gophercloud.ServiceClient
的用法示例。
在下文中一共展示了ServiceClient.Delete方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Delete
// Delete deletes the interface with interfaceID attached to the instance with
// instanceID.
func Delete(c *gophercloud.ServiceClient, instanceID, interfaceID string) DeleteResult {
var res DeleteResult
_, res.Err = c.Delete(deleteURL(c, instanceID, interfaceID), &gophercloud.RequestOpts{
OkCodes: []int{200, 204},
})
return res
}
示例2: Delete
// Delete implements image delete request
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
var res DeleteResult
_, res.Err = client.Delete(deleteURL(client, id), &gophercloud.RequestOpts{
OkCodes: []int{204},
})
return res
}
示例3: Delete
// Delete is the operation responsible for deleting the SSL Termination
// configuration for a load balancer.
func Delete(c *gophercloud.ServiceClient, lbID int) DeleteResult {
var res DeleteResult
_, res.Err = c.Delete(rootURL(c, lbID), &gophercloud.RequestOpts{
OkCodes: []int{200},
})
return res
}
示例4: DeleteMetadatum
// DeleteMetadatum will delete the key-value pair with the given key for the given server ID.
func DeleteMetadatum(client *gophercloud.ServiceClient, id, key string) DeleteMetadatumResult {
var res DeleteMetadatumResult
_, res.Err = client.Delete(metadatumURL(client, id, key), &gophercloud.RequestOpts{
JSONResponse: &res.Body,
})
return res
}
示例5: DeleteErrorPage
// DeleteErrorPage will delete the current error page for the load balancer.
func DeleteErrorPage(client *gophercloud.ServiceClient, id int) gophercloud.ErrResult {
var res gophercloud.ErrResult
_, res.Err = client.Delete(errorPageURL(client, id), &gophercloud.RequestOpts{
OkCodes: []int{200},
})
return res
}
示例6: Revoke
// Revoke immediately makes specified token invalid.
func Revoke(c *gophercloud.ServiceClient, token string) RevokeResult {
var res RevokeResult
_, res.Err = c.Delete(tokenURL(c), &gophercloud.RequestOpts{
MoreHeaders: subjectTokenHeaders(c, token),
})
return res
}
示例7: Abandon
// Abandon deletes the stack with the provided stackName and stackID, but leaves its
// resources intact, and returns data describing the stack and its resources.
func Abandon(c *gophercloud.ServiceClient, stackName, stackID string) AbandonResult {
var res AbandonResult
_, res.Err = c.Delete(abandonURL(c, stackName, stackID), &gophercloud.RequestOpts{
JSONResponse: &res.Body,
OkCodes: []int{200},
})
return res
}
示例8: OpenstackDelete
//OpenstackDelete deletes a resource using OpenStack API
func OpenstackDelete(client *gophercloud.ServiceClient, url string) (interface{}, error) {
_, err := client.Delete(url, &gophercloud.RequestOpts{
OkCodes: []int{200, 201, 202, 204, 404},
})
if err != nil {
return nil, err
}
return nil, nil
}
示例9: Delete
// Delete requests the given policy be permanently deleted.
func Delete(client *gophercloud.ServiceClient, groupID, policyID string) DeleteResult {
var result DeleteResult
url := deleteURL(client, groupID, policyID)
_, result.Err = client.Delete(url, &gophercloud.RequestOpts{
OkCodes: []int{204},
})
return result
}
示例10: Delete
// Delete accepts a unique service ID or URL and deletes the CDN service asset associated with
// it. For example, both "96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0" and
// "https://global.cdn.api.rackspacecloud.com/v1.0/services/96737ae3-cfc1-4c72-be88-5d0e7cc9a3f0"
// are valid options for idOrURL.
func Delete(c *gophercloud.ServiceClient, idOrURL string, opts DeleteOptsBuilder) DeleteResult {
var url string
if strings.Contains(idOrURL, "/") {
url = idOrURL
} else {
url = deleteURL(c, idOrURL)
}
var res DeleteResult
_, res.Err = c.Delete(url, nil)
return res
}
示例11: BulkDelete
// BulkDelete will delete multiple network items from a load balancer's access
// list in a single operation.
func BulkDelete(c *gophercloud.ServiceClient, loadBalancerID int, itemIDs []int) DeleteResult {
var res DeleteResult
if len(itemIDs) > 10 || len(itemIDs) == 0 {
res.Err = errors.New("You must provide a minimum of 1 and a maximum of 10 item IDs")
return res
}
url := rootURL(c, loadBalancerID)
url += gophercloud.IDSliceToQueryString("id", itemIDs)
_, res.Err = c.Delete(url, nil)
return res
}
示例12: Delete
// Delete is a function that deletes an object.
func Delete(c *gophercloud.ServiceClient, containerName, objectName string, opts DeleteOptsBuilder) DeleteResult {
var res DeleteResult
url := deleteURL(c, containerName, objectName)
if opts != nil {
query, err := opts.ToObjectDeleteQuery()
if err != nil {
res.Err = err
return res
}
url += query
}
resp, err := c.Delete(url, nil)
res.Header = resp.Header
res.Err = err
return res
}
示例13: DisassociateMonitor
// DisassociateMonitor will disassociate a health monitor with a particular
// pool. When dissociation is successful, the health monitor will no longer
// check for the health of the members of the pool.
func DisassociateMonitor(c *gophercloud.ServiceClient, poolID, monitorID string) AssociateResult {
var res AssociateResult
_, res.Err = c.Delete(disassociateURL(c, poolID, monitorID), nil)
return res
}
示例14: Delete
// Delete removes an existing service.
// It either deletes all associated endpoints, or fails until all endpoints are deleted.
func Delete(client *gophercloud.ServiceClient, serviceID string) DeleteResult {
var res DeleteResult
_, res.Err = client.Delete(serviceURL(client, serviceID), nil)
return res
}
示例15: Delete
// Delete requests the deletion of a previous stored VolumeAttachment from the server.
func Delete(client *gophercloud.ServiceClient, serverId, aId string) DeleteResult {
var res DeleteResult
_, res.Err = client.Delete(deleteURL(client, serverId, aId), nil)
return res
}