コード例 #1
0
ファイル: authenticate.go プロジェクト: huxoll/gophercloud
// See AccessProvider interface definition for details.
func (a *Access) Revoke(tok string) error {
	url := a.provider.AuthEndpoint + "/" + tok
	err := perigee.Delete(url, perigee.Options{
		MoreHeaders: map[string]string{
			"X-Auth-Token": a.AuthToken(),
		},
		OkCodes: []int{204},
	})
	return err
}
コード例 #2
0
ファイル: region.go プロジェクト: jyidiego/gorax
// DeleteServerById requests that the server with the specified ID
// be removed from your account.  The delete happens asynchronously.
func (r *raxRegion) DeleteServerById(id string) error {
	baseUrl, err := r.EndpointByName("servers")
	serverUrl := fmt.Sprintf("%s/%s", baseUrl, id)
	err = perigee.Delete(serverUrl, perigee.Options{
		MoreHeaders: map[string]string{
			"X-Auth-Token": r.token,
		},
		OkCodes: []int{204},
	})
	return err
}
コード例 #3
0
func (gnp *genericNetworksProvider) DeleteFirewallRule(policyId string) error {
	ep := gnp.endpoint + "/v2.0/fw/firewall_rules/" + policyId
	err := perigee.Delete(ep, perigee.Options{
		MoreHeaders: map[string]string{
			"X-Auth-Token": gnp.access.AuthToken(),
		},
		OkCodes: []int{204},
	})

	return err
}
コード例 #4
0
func (gnp *genericNetworksProvider) DeleteVip(vipId string) error {
	ep := gnp.endpoint + "/v2.0/lb/vips/" + vipId
	err := perigee.Delete(ep, perigee.Options{
		MoreHeaders: map[string]string{
			"X-Auth-Token": gnp.access.AuthToken(),
		},
		OkCodes: []int{204},
	})

	return err
}
コード例 #5
0
func (gnp *genericNetworksProvider) UnassociateMonitor(monitorId string, poolId string) error {
	ep := gnp.endpoint + "/v2.0/lb/pools/" + poolId + "/health_monitors/" + monitorId
	err := perigee.Delete(ep, perigee.Options{
		MoreHeaders: map[string]string{
			"X-Auth-Token": gnp.access.AuthToken(),
		},
		OkCodes: []int{204},
	})

	return err
}
コード例 #6
0
func (gnp *genericNetworksProvider) DeleteSecurityGroup(id string) error {
	ep := gnp.endpoint + "/v2.0/security-groups/" + id
	err := perigee.Delete(ep, perigee.Options{
		MoreHeaders: map[string]string{
			"X-Auth-Token": gnp.access.AuthToken(),
		},
		OkCodes: []int{204},
	})

	return err
}
コード例 #7
0
ファイル: servers.go プロジェクト: ericcapricorn/kubernetes
// See the CloudServersProvider interface for details.
func (gsp *genericServersProvider) DeleteSecurityGroupById(id int) error {
	err := gsp.context.WithReauth(gsp.access, func() error {
		ep := fmt.Sprintf("%s/os-security-groups/%d", gsp.endpoint, id)
		return perigee.Delete(ep, perigee.Options{
			MoreHeaders: map[string]string{
				"X-Auth-Token": gsp.access.AuthToken(),
			},
			OkCodes: []int{202},
		})
	})
	return err
}
コード例 #8
0
ファイル: servers.go プロジェクト: ericcapricorn/kubernetes
// See the CloudServersProvider interface for details.
func (gsp *genericServersProvider) DeleteServerById(id string) error {
	err := gsp.context.WithReauth(gsp.access, func() error {
		url := gsp.endpoint + "/servers/" + id
		return perigee.Delete(url, perigee.Options{
			MoreHeaders: map[string]string{
				"X-Auth-Token": gsp.access.AuthToken(),
			},
			OkCodes: []int{204},
		})
	})
	return err
}
コード例 #9
0
func (gsp *genericServersProvider) DeleteFloatingIp(ip FloatingIp) error {
	return gsp.context.WithReauth(gsp.access, func() error {
		ep := fmt.Sprintf("%s/os-floating-ips/%s", gsp.endpoint, ip.Id)
		return perigee.Delete(ep, perigee.Options{
			CustomClient: gsp.context.httpClient,
			MoreHeaders: map[string]string{
				"X-Auth-Token": gsp.access.AuthToken(),
			},
			OkCodes: []int{202},
		})
	})
}
コード例 #10
0
// See the CloudImagesProvider interface for details.
func (gsp *genericServersProvider) DeleteKeyPair(name string) error {
	err := gsp.context.WithReauth(gsp.access, func() error {
		url := gsp.endpoint + "/os-keypairs/" + name
		return perigee.Delete(url, perigee.Options{
			CustomClient: gsp.context.httpClient,
			MoreHeaders: map[string]string{
				"X-Auth-Token": gsp.access.AuthToken(),
			},
			OkCodes: []int{202},
		})
	})
	return err
}