Exemplo n.º 1
0
func TestDelete(t *testing.T) {
	var apiServer = testUtil.CreateDeleteTestRequestServer(t, token, "/other")
	defer apiServer.Close()

	err := misc.Delete(apiServer.URL+"/other", token, *http.DefaultClient)
	testUtil.IsNil(t, err)
}
Exemplo n.º 2
0
// DeleteFloatingIP will issue a delete query to delete the floating ip.
func (computeService Service) DeleteFloatingIP(floatingIPID string) (err error) {
	reqURL, err := computeService.buildRequestURL("/os-floating-ips/", floatingIPID)
	if err != nil {
		return err
	}

	return misc.Delete(reqURL, computeService.authenticator)
}
Exemplo n.º 3
0
// DeleteInstance will issue a delete query to delete the specified database instance.
func (databaseService Service) DeleteInstance(instanceID string) (err error) {
	reqURL, err := databaseService.buildRequestURL("/instances/", instanceID)
	if err != nil {
		return err
	}

	return misc.Delete(reqURL, databaseService.authenticator)
}
Exemplo n.º 4
0
// DeleteSecurityGroupRule will issue a delete query to delete the specified security group rule.
func (computeService Service) DeleteSecurityGroupRule(securityGroupRuleID string) (err error) {
	reqURL, err := computeService.buildRequestURL("/os-security-group-rules/", securityGroupRuleID)
	if err != nil {
		return err
	}

	return misc.Delete(reqURL, computeService.authenticator)
}
Exemplo n.º 5
0
// DeletePort issues a DELETE to the specified port url to delete it.
func (networkService Service) DeletePort(id string) error {
	reqURL, err := networkService.buildRequestURL("/ports/", id)
	if err != nil {
		return err
	}

	return misc.Delete(reqURL, networkService.authenticator)
}
Exemplo n.º 6
0
// DeleteBackup will issue a delete query to delete the specified backup.
func (databaseService Service) DeleteBackup(backupID string) (err error) {
	reqURL, err := databaseService.buildRequestURL("/backups/", backupID)
	if err != nil {
		return err
	}

	return misc.Delete(reqURL, databaseService.authenticator)
}
Exemplo n.º 7
0
// DeleteRouter will issue a delete query to delete the specified security group.
func (networkService Service) DeleteRouter(routerID string) (err error) {
	reqURL, err := networkService.buildRequestURL("/routers/", routerID)
	if err != nil {
		return err
	}

	return misc.Delete(reqURL, networkService.authenticator)
}
// DeleteSecurityGroup will issue a delete query to delete the specified security group.
func (networkService Service) DeleteSecurityGroup(securityGroupID string) (err error) {
	reqURL, err := networkService.buildRequestURL("/security-groups/", securityGroupID)
	if err != nil {
		return err
	}

	return misc.Delete(reqURL, networkService.authenticator)
}
Exemplo n.º 9
0
// DeleteVolume will delete the volume by id.
func (blockStorageService Service) DeleteVolume(id string) (err error) {
	reqURL, err := blockStorageService.buildRequestURL("/volumes/", id)
	if err != nil {
		return err
	}

	return misc.Delete(reqURL, blockStorageService.authenticator)
}