英文:
How to list fast connect names and not the providers names in OCI using GO SDK?
问题
我正在尝试列出我的VCN可用的FastConnect名称。ListFastConnectProviderServices
的问题在于它列出的是提供商的名称,而不是已创建的FastConnect服务的名称。
以下是我的当前代码:-
func checkFastConnect(compId string) {
provider := common.DefaultConfigProvider()
client, err := core.NewVirtualNetworkClientWithConfigurationProvider(provider)
helpers.FatalIfError(err)
request := core.ListFastConnectProviderServicesRequest{
CompartmentId: &compId,
}
resp, err := client.ListFastConnectProviderServices(context.Background(), request)
helpers.FatalIfError(err)
fmt.Println(resp)
}
请问是否有人可以指导我正确的API调用方式或提供一些参考资料,以获取我创建的FastConnect服务的名称,而不是提供商的名称?
谢谢。
英文:
I am trying to list fastconnect names that are available for my VCN. The problem with ListFastConnectProviderServices
is that it lists the names of providers rather than the names of created FastConnects services.
Here is my current code:-
func checkFastConnect(compId string) {
provider := common.DefaultConfigProvider()
client, err := core.NewVirtualNetworkClientWithConfigurationProvider(provider)
helpers.FatalIfError(err)
request := core.ListFastConnectProviderServicesRequest{
CompartmentId: &compId,
}
resp, err := client.ListFastConnectProviderServices(context.Background(), request)
helpers.FatalIfError(err)
fmt.Println(resp)
}
Can someone please point me to correct API call or some reference where I can get FastConnects services that I created rather than providers name?
Thanks
答案1
得分: 2
我找到了答案来回应我的问题。实际上,正确的 API 是 ListVirtualCircuitsRequest
:
func checkFastConnect(compId string) {
provider := common.DefaultConfigProvider()
client, err := core.NewVirtualNetworkClientWithConfigurationProvider(provider)
helpers.FatalIfError(err)
request := core.ListVirtualCircuitsRequest{
CompartmentId: &compId,
}
resp, err := client.ListVirtualCircuits(context.Background(), request)
helpers.FatalIfError(err)
fmt.Println(resp)
}
英文:
Found answer to my own query. Actually the correct API is ListVirtualCircuitsRequest
:-
func checkFastConnect(compId string) {
provider := common.DefaultConfigProvider()
client, err := core.NewVirtualNetworkClientWithConfigurationProvider(provider)
helpers.FatalIfError(err)
request := core.ListVirtualCircuitsRequest{
CompartmentId: &compId,
}
resp, err := client.ListVirtualCircuits(context.Background(), request)
helpers.FatalIfError(err)
fmt.Println(resp)
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论