當前位置: 首頁>>代碼示例>>Golang>>正文


Golang perigee.Delete函數代碼示例

本文整理匯總了Golang中github.com/racker/perigee.Delete函數的典型用法代碼示例。如果您正苦於以下問題:Golang Delete函數的具體用法?Golang Delete怎麽用?Golang Delete使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Delete函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Revoke

// 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
}
開發者ID:huxoll,項目名稱:gophercloud,代碼行數:11,代碼來源:authenticate.go

示例2: DeleteServerById

// 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
}
開發者ID:jyidiego,項目名稱:gorax,代碼行數:13,代碼來源:region.go

示例3: DeleteFirewallRule

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
}
開發者ID:haklop,項目名稱:gophercloud-extensions,代碼行數:11,代碼來源:network.go

示例4: DeleteVip

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
}
開發者ID:haklop,項目名稱:gophercloud-extensions,代碼行數:11,代碼來源:network.go

示例5: UnassociateMonitor

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
}
開發者ID:haklop,項目名稱:gophercloud-extensions,代碼行數:11,代碼來源:network.go

示例6: DeleteSecurityGroup

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
}
開發者ID:haklop,項目名稱:gophercloud-extensions,代碼行數:11,代碼來源:network.go

示例7: DeleteSecurityGroupById

// 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
}
開發者ID:ericcapricorn,項目名稱:kubernetes,代碼行數:13,代碼來源:servers.go

示例8: DeleteServerById

// 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
}
開發者ID:ericcapricorn,項目名稱:kubernetes,代碼行數:13,代碼來源:servers.go

示例9: DeleteFloatingIp

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},
		})
	})
}
開發者ID:karlpilkington,項目名稱:golang-devops-stuff,代碼行數:12,代碼來源:floating_ips.go

示例10: DeleteKeyPair

// 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
}
開發者ID:WIZARD-CXY,項目名稱:golang-devops-stuff,代碼行數:14,代碼來源:keypairs.go


注:本文中的github.com/racker/perigee.Delete函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。