jjzjj

softlayer

全部标签

go - 如何添加对象掩码以使用 golang 调用 GetNetworkVlans

funcgetPrivateVlan(envstring)(string,error){//1.Createasessionsess:=session.New(user,pass)//2.GetaserviceaccountService:=services.GetAccountService(sess)//3.Invokeamethod:vlans,err:=accountService.GetNetworkVlans()vlan:=vlans[0]log.Println(*vlan.Name)//workslog.Println(*vlan.PrimaryRouter)//Does

go - 如何订购为网关及其成员配置 ssh 的软层网络网关

如何订购为网关及其成员配置ssh的软层网络网关packagemainimport("fmt""github.com/softlayer/softlayer-go/datatypes""github.com/softlayer/softlayer-go/services""github.com/softlayer/softlayer-go/session""github.com/softlayer/softlayer-go/sl""encoding/json")funcmain(){//SoftLayerAPIusernameandkeyusername:="setme"apikey:=

go - 您可以通过 virtual.go :EditObject()? 编辑 vdi 带宽分配吗

我正在使用此脚本的修改版本:https://softlayer.github.io/go/edit_virtual_guest.go/脚本是一样的,除了我的objectTemplate看起来像:varobjectTemplatedatatypes.Virtual_GuestobjectTemplate.BandwidthAllocation=sl.Float(250)运行后的输出是“VirtualGuestServerwassuccessfullyedited”但是我的vsi没有在ui中显示更新的带宽。是否可以使用EditObject调用来编辑带宽?是否可以使用不同的API调用来编辑带

session - 用于在 golang 中关闭 session 的 Softlayer API?

我正在使用softlayergo客户端https://github.com/softlayer/softlayer-go我无法关闭软层session。我该怎么做?我已经使用Session.New()API创建了软层session。引用:-https://github.com/softlayer/softlayer-go/blob/master/session/session.go 最佳答案 https://github.com/softlayer/softlayer-go/blob/master/session/session.go

SoftLayer API网站不可用?

我可以问你的问题吗?我搜索了sldn.softlayer.com,以查找SoftLayerAPI。但是该网站暂时不可用。该网站会集成到蓝色吗?还是临时的技术问题?谢谢。此致看答案不,我认为它不会集成到蓝色。这可能是暂时的技术问题,因为我现在仍在看到这个问题。

go - 软层 SDK SoftLayer_Exception_Public : Access Denied

使用GoSDK中的示例,返回用户名和apikey{"error":"AccessDenied.","code":"SoftLayer_Exception_Public"}packagemainimport("fmt""github.com/softlayer/softlayer-go/services""github.com/softlayer/softlayer-go/session""github.com/softlayer/softlayer-go/sl")funcmain(){userName:="xxxx"apikey:="xxxx"sess:=session.New(use

go - 软层 SDK SoftLayer_Exception_Public : Access Denied

使用GoSDK中的示例,返回用户名和apikey{"error":"AccessDenied.","code":"SoftLayer_Exception_Public"}packagemainimport("fmt""github.com/softlayer/softlayer-go/services""github.com/softlayer/softlayer-go/session""github.com/softlayer/softlayer-go/sl")funcmain(){userName:="xxxx"apikey:="xxxx"sess:=session.New(use

go - 如何在 Golang 中编写客户端代码来调用 createSnapshot softlayer API

作为Golang的新手(事实上,几天前才开始学习)我有一个非常基本的问题,即创建用于使用SLAPI的客户端代码。所以我的要求是使用Golang调用createsnapshotSLAPI,这将拍摄我的耐力卷的快照,前提是卷ID是它的输入参数。你能帮我写一个示例代码来写这个客户端吗?我知道如何在python中做到这一点,这是我在python中的做法,但现在我想在golang中做到这一点(改变要求。你知道;))python代码片段:client=SoftLayer.create_client_from_env("softlayerusername","softlayerapikey")res

go - 如何在 Golang 中编写客户端代码来调用 createSnapshot softlayer API

作为Golang的新手(事实上,几天前才开始学习)我有一个非常基本的问题,即创建用于使用SLAPI的客户端代码。所以我的要求是使用Golang调用createsnapshotSLAPI,这将拍摄我的耐力卷的快照,前提是卷ID是它的输入参数。你能帮我写一个示例代码来写这个客户端吗?我知道如何在python中做到这一点,这是我在python中的做法,但现在我想在golang中做到这一点(改变要求。你知道;))python代码片段:client=SoftLayer.create_client_from_env("softlayerusername","softlayerapikey")res

go - 使用 SoftLayer API 时掩码和过滤器不起作用

当我将billingItemFlag添加到我的掩码并进行过滤时,结果中缺少它。我正在使用SoftLayer-goapi来自SoftLayerGitHub帐户。我的过滤器或面具错了吗?请考虑以下代码:constmaskstring="id;hostname;domain;billingItemFlag;billingItem"varfilters=filter.Build(filter.Path("billingItemFlag").NotNull(),filter.Path("billingItem").NotNull(),)accountService:=services.GetAc
12