本文整理汇总了Golang中github.com/absolutedevops/civo/config.URL函数的典型用法代码示例。如果您正苦于以下问题:Golang URL函数的具体用法?Golang URL怎么用?Golang URL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了URL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: InstancesList
func InstancesList(tags string) (json *gabs.Container, err error) {
if tags != "" {
return makeJSONCall(config.URL()+"/v1/instances?tags="+tags, HTTPGet, "")
} else {
return makeJSONCall(config.URL()+"/v1/instances", HTTPGet, "")
}
}
开发者ID:absolutedevops,项目名称:civo,代码行数:7,代码来源:instances.go
示例2: QuotaGet
func QuotaGet(account string) (json *gabs.Container, err error) {
if account != "" {
return makeJSONCall(config.URL()+"/v1/quota?username="+account, HTTPGet, "")
} else {
return makeJSONCall(config.URL()+"/v1/quota", HTTPGet, "")
}
}
开发者ID:absolutedevops,项目名称:civo,代码行数:7,代码来源:quotas.go
示例3: InstanceReboot
func InstanceReboot(id string, hard bool) (json *gabs.Container, err error) {
if hard {
return makeJSONCall(config.URL()+"/v1/instances/"+id+"/hard_reboots", HTTPPost, "")
} else {
return makeJSONCall(config.URL()+"/v1/instances/"+id+"/soft_reboots", HTTPPost, "")
}
}
开发者ID:absolutedevops,项目名称:civo,代码行数:7,代码来源:instances.go
示例4: SnapshotCreate
func SnapshotCreate(name, instance_id string, safe bool) (json *gabs.Container, err error) {
saveVal := "false"
if safe {
saveVal = "true"
}
return makeJSONCall(config.URL()+"/v1/snapshots/"+name, HTTPPut, "instance_id="+instance_id+"&safe="+saveVal)
}
开发者ID:absolutedevops,项目名称:civo,代码行数:7,代码来源:snapshots.go
示例5: IPCreate
func IPCreate(instanceID string, public bool) (json *gabs.Container, err error) {
params := ""
if public {
params = "public=true"
}
return makeJSONCall(config.URL()+"/v1/instances/"+instanceID+"/ip", HTTPPost, params)
}
开发者ID:absolutedevops,项目名称:civo,代码行数:7,代码来源:ips.go
示例6: AccountFindByToken
func AccountFindByToken(token string) string {
accounts, err := makeJSONCall(config.URL()+"/v1/accounts", HTTPGet, "")
if err != nil {
fmt.Println(err)
return ""
}
items, _ := accounts.Children()
for _, child := range items {
if child.S("api_key").Data().(string) == token {
return child.S("username").Data().(string)
}
}
return ""
}
开发者ID:absolutedevops,项目名称:civo,代码行数:15,代码来源:accounts.go
示例7: InstanceDestroy
func InstanceDestroy(id string) (json *gabs.Container, err error) {
return makeJSONCall(config.URL()+"/v1/instances/"+id, HTTPDelete, "")
}
开发者ID:absolutedevops,项目名称:civo,代码行数:3,代码来源:instances.go
示例8: AccountDelete
func AccountDelete(name string) (json *gabs.Container, err error) {
return makeJSONCall(config.URL()+"/v1/accounts/"+name, HTTPDelete, "")
}
开发者ID:absolutedevops,项目名称:civo,代码行数:3,代码来源:accounts.go
示例9: AccountReset
func AccountReset(name string) (json *gabs.Container, err error) {
return makeJSONCall(config.URL()+"/v1/accounts/"+name, HTTPPut, fmt.Sprintf("name=%s", name))
}
开发者ID:absolutedevops,项目名称:civo,代码行数:3,代码来源:accounts.go
示例10: RegionsList
func RegionsList() (json *gabs.Container, err error) {
return makeJSONCall(config.URL()+"/v1/regions", HTTPGet, "")
}
开发者ID:absolutedevops,项目名称:civo,代码行数:3,代码来源:regions.go
示例11: AccountCreate
func AccountCreate(name string) (json *gabs.Container, err error) {
return makeJSONCall(config.URL()+"/v1/accounts", HTTPPost, fmt.Sprintf("name=%s", name))
}
开发者ID:absolutedevops,项目名称:civo,代码行数:3,代码来源:accounts.go
示例12: FirewallRuleDelete
func FirewallRuleDelete(name, id string) (json *gabs.Container, err error) {
return makeJSONCall(config.URL()+"/v1/firewalls/"+name+"/rules/"+id, HTTPDelete, "")
}
开发者ID:absolutedevops,项目名称:civo,代码行数:3,代码来源:firewalls.go
示例13: SshKeyCreate
func SshKeyCreate(params SshKeyParams) (json *gabs.Container, err error) {
v, _ := query.Values(params)
return makeJSONCall(config.URL()+"/v1/sshkeys", HTTPPost, v.Encode())
}
开发者ID:absolutedevops,项目名称:civo,代码行数:4,代码来源:sshkeys.go
示例14: FirewallCreate
func FirewallCreate(name string) (json *gabs.Container, err error) {
return makeJSONCall(config.URL()+"/v1/firewalls", HTTPPost, "name="+name)
}
开发者ID:absolutedevops,项目名称:civo,代码行数:3,代码来源:firewalls.go
示例15: FirewallRules
func FirewallRules(name string) (json *gabs.Container, err error) {
return makeJSONCall(config.URL()+"/v1/firewalls/"+name+"/rules", HTTPGet, "")
}
开发者ID:absolutedevops,项目名称:civo,代码行数:3,代码来源:firewalls.go
示例16: AccountsList
func AccountsList() (json *gabs.Container, err error) {
return makeJSONCall(config.URL()+"/v1/accounts", HTTPGet, "")
}
开发者ID:absolutedevops,项目名称:civo,代码行数:3,代码来源:accounts.go
示例17: SnapshotsList
func SnapshotsList() (json *gabs.Container, err error) {
return makeJSONCall(config.URL()+"/v1/snapshots", HTTPGet, "")
}
开发者ID:absolutedevops,项目名称:civo,代码行数:3,代码来源:snapshots.go
示例18: InstanceCreate
func InstanceCreate(params InstanceParams) (json *gabs.Container, err error) {
v, _ := query.Values(params)
return makeJSONCall(config.URL()+"/v1/instances", HTTPPost, v.Encode())
}
开发者ID:absolutedevops,项目名称:civo,代码行数:4,代码来源:instances.go
示例19: SnapshotDestroy
func SnapshotDestroy(id string) (json *gabs.Container, err error) {
return makeJSONCall(config.URL()+"/v1/snapshots/"+id, HTTPDelete, "")
}
开发者ID:absolutedevops,项目名称:civo,代码行数:3,代码来源:snapshots.go
示例20: QuotaSet
func QuotaSet(params QuotaParams) (json *gabs.Container, err error) {
v, _ := query.Values(params)
return makeJSONCall(config.URL()+"/v1/quota/"+params.Account, HTTPPut, v.Encode())
}
开发者ID:absolutedevops,项目名称:civo,代码行数:4,代码来源:quotas.go
注:本文中的github.com/absolutedevops/civo/config.URL函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论