telnyx-networking-go
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
<!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. -->
Telnyx Networking - Go
Telnyx 网络服务 - Go
Installation
安装
bash
go get github.com/team-telnyx/telnyx-gobash
go get github.com/team-telnyx/telnyx-goSetup
配置
go
import (
"context"
"fmt"
"os"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
client := telnyx.NewClient(
option.WithAPIKey(os.Getenv("TELNYX_API_KEY")),
)All examples below assume is already initialized as shown above.
clientgo
import (
"context"
"fmt"
"os"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
client := telnyx.NewClient(
option.WithAPIKey(os.Getenv("TELNYX_API_KEY")),
)以下所有示例均假设已按照上述方式完成初始化。
clientError Handling
错误处理
All API calls can fail with network errors, rate limits (429), validation errors (422),
or authentication errors (401). Always handle errors in production code:
go
import "errors"
result, err := client.Messages.Send(ctx, params)
if err != nil {
var apiErr *telnyx.Error
if errors.As(err, &apiErr) {
switch apiErr.StatusCode {
case 422:
fmt.Println("Validation error — check required fields and formats")
case 429:
// Rate limited — wait and retry with exponential backoff
fmt.Println("Rate limited, retrying...")
default:
fmt.Printf("API error %d: %s\n", apiErr.StatusCode, apiErr.Error())
}
} else {
fmt.Println("Network error — check connectivity and retry")
}
}Common error codes: invalid API key, insufficient permissions,
resource not found, validation error (check field formats),
rate limited (retry with exponential backoff).
401403404422429所有API调用都可能遇到网络错误、速率限制(429)、校验错误(422)或认证错误(401)。在生产代码中请务必做好错误处理:
go
import "errors"
result, err := client.Messages.Send(ctx, params)
if err != nil {
var apiErr *telnyx.Error
if errors.As(err, &apiErr) {
switch apiErr.StatusCode {
case 422:
fmt.Println("校验错误 — 请检查必填字段和格式")
case 429:
// 触发速率限制 — 等待后按指数退避策略重试
fmt.Println("触发速率限制,正在重试...")
default:
fmt.Printf("API错误 %d: %s\n", apiErr.StatusCode, apiErr.Error())
}
} else {
fmt.Println("网络错误 — 请检查网络连接后重试")
}
}常见错误码: API密钥无效, 权限不足, 资源不存在, 校验错误(检查字段格式), 触发速率限制(按指数退避策略重试)。
401403404422429Important Notes
注意事项
- Pagination: Use for automatic iteration:
ListAutoPaging().iter := client.Resource.ListAutoPaging(ctx, params); for iter.Next() { item := iter.Current() }
- 分页: 使用实现自动遍历:
ListAutoPaging()。iter := client.Resource.ListAutoPaging(ctx, params); for iter.Next() { item := iter.Current() }
List all clusters
列出所有集群
GET /ai/clustersgo
page, err := client.AI.Clusters.List(context.Background(), telnyx.AIClusterListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (string), (date-time), (date-time), (integer), (integer), (enum: pending, starting, running, completed, failed), (string)
bucketcreated_atfinished_atmin_cluster_sizemin_subcluster_sizestatustask_idGET /ai/clustersgo
page, err := client.AI.Clusters.List(context.Background(), telnyx.AIClusterListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数:(字符串)、(日期时间)、(日期时间)、(整数)、(整数)、(枚举值:pending、starting、running、completed、failed)、(字符串)
bucketcreated_atfinished_atmin_cluster_sizemin_subcluster_sizestatustask_idCompute new clusters
计算新集群
Starts a background task to compute how the data in an embedded storage bucket is clustered. This helps identify common themes and patterns in the data.
POST /ai/clustersbucketOptional: (array[string]), (integer), (integer), (string)
filesmin_cluster_sizemin_subcluster_sizeprefixgo
response, err := client.AI.Clusters.Compute(context.Background(), telnyx.AIClusterComputeParams{
Bucket: "my-bucket",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.Data)Returns: (string)
task_id启动一个后台任务,计算嵌入式存储桶中的数据的聚类方式。该功能可帮助识别数据中的通用主题和模式。
POST /ai/clustersbucket可选参数:(字符串数组)、(整数)、(整数)、(字符串)
filesmin_cluster_sizemin_subcluster_sizeprefixgo
response, err := client.AI.Clusters.Compute(context.Background(), telnyx.AIClusterComputeParams{
Bucket: "my-bucket",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response.Data)返回参数:(字符串)
task_idFetch a cluster
获取单个集群
GET /ai/clusters/{task_id}go
cluster, err := client.AI.Clusters.Get(
context.Background(),
"task_id",
telnyx.AIClusterGetParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", cluster.Data)Returns: (string), (array[object]), (enum: pending, starting, running, completed, failed)
bucketclustersstatusGET /ai/clusters/{task_id}go
cluster, err := client.AI.Clusters.Get(
context.Background(),
"task_id",
telnyx.AIClusterGetParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", cluster.Data)返回参数:(字符串)、(对象数组)、(枚举值:pending、starting、running、completed、failed)
bucketclustersstatusDelete a cluster
删除集群
DELETE /ai/clusters/{task_id}go
err := client.AI.Clusters.Delete(context.Background(), "task_id")
if err != nil {
log.Fatal(err)
}DELETE /ai/clusters/{task_id}go
err := client.AI.Clusters.Delete(context.Background(), "task_id")
if err != nil {
log.Fatal(err)
}Fetch a cluster visualization
获取集群可视化数据
GET /ai/clusters/{task_id}/graphgo
response, err := client.AI.Clusters.FetchGraph(
context.Background(),
"task_id",
telnyx.AIClusterFetchGraphParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response)GET /ai/clusters/{task_id}/graphgo
response, err := client.AI.Clusters.FetchGraph(
context.Background(),
"task_id",
telnyx.AIClusterFetchGraphParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response)List Integrations
列出所有集成
List all available integrations.
GET /ai/integrationsgo
integrations, err := client.AI.Integrations.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", integrations.Data)Returns: (array[string]), (string), (string), (string), (string), (string), (enum: disconnected, connected)
available_toolsdescriptiondisplay_nameidlogo_urlnamestatus列出所有可用的集成。
GET /ai/integrationsgo
integrations, err := client.AI.Integrations.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", integrations.Data)返回参数:(字符串数组)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(枚举值:disconnected、connected)
available_toolsdescriptiondisplay_nameidlogo_urlnamestatusList User Integrations
列出用户集成
List user setup integrations
GET /ai/integrations/connectionsgo
connections, err := client.AI.Integrations.Connections.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", connections.Data)Returns: (array[string]), (string), (string)
allowed_toolsidintegration_id列出用户已配置的集成
GET /ai/integrations/connectionsgo
connections, err := client.AI.Integrations.Connections.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", connections.Data)返回参数:(字符串数组)、(字符串)、(字符串)
allowed_toolsidintegration_idGet User Integration connection By Id
根据ID获取用户集成连接
Get user setup integrations
GET /ai/integrations/connections/{user_connection_id}go
connection, err := client.AI.Integrations.Connections.Get(context.Background(), "user_connection_id")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", connection.Data)Returns: (array[string]), (string), (string)
allowed_toolsidintegration_id获取用户已配置的集成
GET /ai/integrations/connections/{user_connection_id}go
connection, err := client.AI.Integrations.Connections.Get(context.Background(), "user_connection_id")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", connection.Data)返回参数:(字符串数组)、(字符串)、(字符串)
allowed_toolsidintegration_idDelete Integration Connection
删除集成连接
Delete a specific integration connection.
DELETE /ai/integrations/connections/{user_connection_id}go
err := client.AI.Integrations.Connections.Delete(context.Background(), "user_connection_id")
if err != nil {
log.Fatal(err)
}删除指定的集成连接。
DELETE /ai/integrations/connections/{user_connection_id}go
err := client.AI.Integrations.Connections.Delete(context.Background(), "user_connection_id")
if err != nil {
log.Fatal(err)
}List Integration By Id
根据ID获取集成
Retrieve integration details
GET /ai/integrations/{integration_id}go
integration, err := client.AI.Integrations.Get(context.Background(), "integration_id")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", integration.ID)Returns: (array[string]), (string), (string), (string), (string), (string), (enum: disconnected, connected)
available_toolsdescriptiondisplay_nameidlogo_urlnamestatus查询集成详情
GET /ai/integrations/{integration_id}go
integration, err := client.AI.Integrations.Get(context.Background(), "integration_id")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", integration.ID)返回参数:(字符串数组)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(枚举值:disconnected、connected)
available_toolsdescriptiondisplay_nameidlogo_urlnamestatusList all Global IP Allowed Ports
列出所有全局IP允许端口
GET /global_ip_allowed_portsgo
globalIPAllowedPorts, err := client.GlobalIPAllowedPorts.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAllowedPorts.Data)Returns: (integer), (uuid), (integer), (string), (string), (string)
first_portidlast_portnameprotocol_coderecord_typeGET /global_ip_allowed_portsgo
globalIPAllowedPorts, err := client.GlobalIPAllowedPorts.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAllowedPorts.Data)返回参数:(整数)、(uuid)、(整数)、(字符串)、(字符串)、(字符串)
first_portidlast_portnameprotocol_coderecord_typeGlobal IP Assignment Health Check Metrics
全局IP分配健康检查指标
GET /global_ip_assignment_healthgo
globalIPAssignmentHealth, err := client.GlobalIPAssignmentHealth.Get(context.Background(), telnyx.GlobalIPAssignmentHealthGetParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAssignmentHealth.Data)Returns: (object), (object), (object), (date-time)
global_ipglobal_ip_assignmenthealthtimestampGET /global_ip_assignment_healthgo
globalIPAssignmentHealth, err := client.GlobalIPAssignmentHealth.Get(context.Background(), telnyx.GlobalIPAssignmentHealthGetParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAssignmentHealth.Data)返回参数:(对象)、(对象)、(对象)、(日期时间)
global_ipglobal_ip_assignmenthealthtimestampList all Global IP assignments
列出所有全局IP分配
List all Global IP assignments.
GET /global_ip_assignmentsgo
page, err := client.GlobalIPAssignments.List(context.Background(), telnyx.GlobalIPAssignmentListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (string), (uuid), (uuid), (boolean), (boolean), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string), (uuid)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_id列出所有全局IP分配记录。
GET /global_ip_assignmentsgo
page, err := client.GlobalIPAssignments.List(context.Background(), telnyx.GlobalIPAssignmentListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数:(字符串)、(uuid)、(uuid)、(布尔值)、(布尔值)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)、(uuid)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_idCreate a Global IP assignment
创建全局IP分配
Create a Global IP assignment.
POST /global_ip_assignmentsOptional: (string), (uuid), (uuid), (boolean), (boolean), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string), (uuid)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_idgo
globalIPAssignment, err := client.GlobalIPAssignments.New(context.Background(), telnyx.GlobalIPAssignmentNewParams{
GlobalIPAssignment: telnyx.GlobalIPAssignmentParam{},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAssignment.Data)Returns: (string), (uuid), (uuid), (boolean), (boolean), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string), (uuid)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_id创建一个全局IP分配记录。
POST /global_ip_assignments可选参数:(字符串)、(uuid)、(uuid)、(布尔值)、(布尔值)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)、(uuid)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_idgo
globalIPAssignment, err := client.GlobalIPAssignments.New(context.Background(), telnyx.GlobalIPAssignmentNewParams{
GlobalIPAssignment: telnyx.GlobalIPAssignmentParam{},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAssignment.Data)返回参数:(字符串)、(uuid)、(uuid)、(布尔值)、(布尔值)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)、(uuid)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_idRetrieve a Global IP
查询全局IP
Retrieve a Global IP assignment.
GET /global_ip_assignments/{id}go
globalIPAssignment, err := client.GlobalIPAssignments.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAssignment.Data)Returns: (string), (uuid), (uuid), (boolean), (boolean), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string), (uuid)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_id查询单个全局IP分配记录。
GET /global_ip_assignments/{id}go
globalIPAssignment, err := client.GlobalIPAssignments.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAssignment.Data)返回参数:(字符串)、(uuid)、(uuid)、(布尔值)、(布尔值)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)、(uuid)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_idUpdate a Global IP assignment
更新全局IP分配
Update a Global IP assignment.
PATCH /global_ip_assignments/{id}Optional: (string), (string), (uuid), (boolean), (boolean), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string), (string)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_idgo
globalIPAssignment, err := client.GlobalIPAssignments.Update(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.GlobalIPAssignmentUpdateParams{
GlobalIPAssignmentUpdateRequest: telnyx.GlobalIPAssignmentUpdateParamsGlobalIPAssignmentUpdateRequest{
GlobalIPAssignmentParam: telnyx.GlobalIPAssignmentParam{},
},
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAssignment.Data)Returns: (string), (uuid), (uuid), (boolean), (boolean), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string), (uuid)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_id更新全局IP分配记录。
PATCH /global_ip_assignments/{id}可选参数:(字符串)、(字符串)、(uuid)、(布尔值)、(布尔值)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)、(字符串)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_idgo
globalIPAssignment, err := client.GlobalIPAssignments.Update(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.GlobalIPAssignmentUpdateParams{
GlobalIPAssignmentUpdateRequest: telnyx.GlobalIPAssignmentUpdateParamsGlobalIPAssignmentUpdateRequest{
GlobalIPAssignmentParam: telnyx.GlobalIPAssignmentParam{},
},
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAssignment.Data)返回参数:(字符串)、(uuid)、(uuid)、(布尔值)、(布尔值)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)、(uuid)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_idDelete a Global IP assignment
删除全局IP分配
Delete a Global IP assignment.
DELETE /global_ip_assignments/{id}go
globalIPAssignment, err := client.GlobalIPAssignments.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAssignment.Data)Returns: (string), (uuid), (uuid), (boolean), (boolean), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string), (uuid)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_id删除全局IP分配记录。
DELETE /global_ip_assignments/{id}go
globalIPAssignment, err := client.GlobalIPAssignments.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAssignment.Data)返回参数:(字符串)、(uuid)、(uuid)、(布尔值)、(布尔值)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)、(uuid)
created_atglobal_ip_ididis_announcedis_connectedis_in_maintenancerecord_typestatusupdated_atwireguard_peer_idGlobal IP Assignment Usage Metrics
全局IP分配使用指标
GET /global_ip_assignments_usagego
globalIPAssignmentsUsage, err := client.GlobalIPAssignmentsUsage.Get(context.Background(), telnyx.GlobalIPAssignmentsUsageGetParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAssignmentsUsage.Data)Returns: (object), (object), (object), (date-time), (object)
global_ipglobal_ip_assignmentreceivedtimestamptransmittedGET /global_ip_assignments_usagego
globalIPAssignmentsUsage, err := client.GlobalIPAssignmentsUsage.Get(context.Background(), telnyx.GlobalIPAssignmentsUsageGetParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPAssignmentsUsage.Data)返回参数:(对象)、(对象)、(对象)、(日期时间)、(对象)
global_ipglobal_ip_assignmentreceivedtimestamptransmittedList all Global IP Health check types
列出所有全局IP健康检查类型
List all Global IP Health check types.
GET /global_ip_health_check_typesgo
globalIPHealthCheckTypes, err := client.GlobalIPHealthCheckTypes.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPHealthCheckTypes.Data)Returns: (object), (string), (string)
health_check_paramshealth_check_typerecord_type列出所有全局IP健康检查类型。
GET /global_ip_health_check_typesgo
globalIPHealthCheckTypes, err := client.GlobalIPHealthCheckTypes.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPHealthCheckTypes.Data)返回参数:(对象)、(字符串)、(字符串)
health_check_paramshealth_check_typerecord_typeList all Global IP health checks
列出所有全局IP健康检查
List all Global IP health checks.
GET /global_ip_health_checksgo
page, err := client.GlobalIPHealthChecks.List(context.Background(), telnyx.GlobalIPHealthCheckListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (string), (uuid), (object), (string), (uuid), (string), (string)
created_atglobal_ip_idhealth_check_paramshealth_check_typeidrecord_typeupdated_at列出所有全局IP健康检查记录。
GET /global_ip_health_checksgo
page, err := client.GlobalIPHealthChecks.List(context.Background(), telnyx.GlobalIPHealthCheckListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数:(字符串)、(uuid)、(对象)、(字符串)、(uuid)、(字符串)、(字符串)
created_atglobal_ip_idhealth_check_paramshealth_check_typeidrecord_typeupdated_atCreate a Global IP health check
创建全局IP健康检查
Create a Global IP health check.
POST /global_ip_health_checksOptional: (string), (uuid), (object), (string), (uuid), (string), (string)
created_atglobal_ip_idhealth_check_paramshealth_check_typeidrecord_typeupdated_atgo
globalIPHealthCheck, err := client.GlobalIPHealthChecks.New(context.Background(), telnyx.GlobalIPHealthCheckNewParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPHealthCheck.Data)Returns: (string), (uuid), (object), (string), (uuid), (string), (string)
created_atglobal_ip_idhealth_check_paramshealth_check_typeidrecord_typeupdated_at创建全局IP健康检查记录。
POST /global_ip_health_checks可选参数:(字符串)、(uuid)、(对象)、(字符串)、(uuid)、(字符串)、(字符串)
created_atglobal_ip_idhealth_check_paramshealth_check_typeidrecord_typeupdated_atgo
globalIPHealthCheck, err := client.GlobalIPHealthChecks.New(context.Background(), telnyx.GlobalIPHealthCheckNewParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPHealthCheck.Data)返回参数:(字符串)、(uuid)、(对象)、(字符串)、(uuid)、(字符串)、(字符串)
created_atglobal_ip_idhealth_check_paramshealth_check_typeidrecord_typeupdated_atRetrieve a Global IP health check
查询全局IP健康检查
Retrieve a Global IP health check.
GET /global_ip_health_checks/{id}go
globalIPHealthCheck, err := client.GlobalIPHealthChecks.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPHealthCheck.Data)Returns: (string), (uuid), (object), (string), (uuid), (string), (string)
created_atglobal_ip_idhealth_check_paramshealth_check_typeidrecord_typeupdated_at查询单个全局IP健康检查记录。
GET /global_ip_health_checks/{id}go
globalIPHealthCheck, err := client.GlobalIPHealthChecks.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPHealthCheck.Data)返回参数:(字符串)、(uuid)、(对象)、(字符串)、(uuid)、(字符串)、(字符串)
created_atglobal_ip_idhealth_check_paramshealth_check_typeidrecord_typeupdated_atDelete a Global IP health check
删除全局IP健康检查
Delete a Global IP health check.
DELETE /global_ip_health_checks/{id}go
globalIPHealthCheck, err := client.GlobalIPHealthChecks.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPHealthCheck.Data)Returns: (string), (uuid), (object), (string), (uuid), (string), (string)
created_atglobal_ip_idhealth_check_paramshealth_check_typeidrecord_typeupdated_at删除全局IP健康检查记录。
DELETE /global_ip_health_checks/{id}go
globalIPHealthCheck, err := client.GlobalIPHealthChecks.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPHealthCheck.Data)返回参数:(字符串)、(uuid)、(对象)、(字符串)、(uuid)、(字符串)、(字符串)
created_atglobal_ip_idhealth_check_paramshealth_check_typeidrecord_typeupdated_atGlobal IP Latency Metrics
全局IP延迟指标
GET /global_ip_latencygo
globalIPLatency, err := client.GlobalIPLatency.Get(context.Background(), telnyx.GlobalIPLatencyGetParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPLatency.Data)Returns: (object), (object), (object), (object), (date-time)
global_ipmean_latencypercentile_latencyprober_locationtimestampGET /global_ip_latencygo
globalIPLatency, err := client.GlobalIPLatency.Get(context.Background(), telnyx.GlobalIPLatencyGetParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPLatency.Data)返回参数:(对象)、(对象)、(对象)、(对象)、(日期时间)
global_ipmean_latencypercentile_latencyprober_locationtimestampList all Global IP Protocols
列出所有全局IP协议
GET /global_ip_protocolsgo
globalIPProtocols, err := client.GlobalIPProtocols.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPProtocols.Data)Returns: (string), (string), (string)
codenamerecord_typeGET /global_ip_protocolsgo
globalIPProtocols, err := client.GlobalIPProtocols.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPProtocols.Data)返回参数:(字符串)、(字符串)、(字符串)
codenamerecord_typeGlobal IP Usage Metrics
全局IP使用指标
GET /global_ip_usagego
globalIPUsage, err := client.GlobalIPUsage.Get(context.Background(), telnyx.GlobalIPUsageGetParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPUsage.Data)Returns: (object), (object), (date-time), (object)
global_ipreceivedtimestamptransmittedGET /global_ip_usagego
globalIPUsage, err := client.GlobalIPUsage.Get(context.Background(), telnyx.GlobalIPUsageGetParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIPUsage.Data)返回参数:(对象)、(对象)、(日期时间)、(对象)
global_ipreceivedtimestamptransmittedList all Global IPs
列出所有全局IP
List all Global IPs.
GET /global_ipsgo
page, err := client.GlobalIPs.List(context.Background(), telnyx.GlobalIPListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (string), (string), (uuid), (string), (string), (object), (string), (string)
created_atdescriptionidip_addressnameportsrecord_typeupdated_at列出所有全局IP记录。
GET /global_ipsgo
page, err := client.GlobalIPs.List(context.Background(), telnyx.GlobalIPListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数:(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)、(字符串)
created_atdescriptionidip_addressnameportsrecord_typeupdated_atCreate a Global IP
创建全局IP
Create a Global IP.
POST /global_ipsOptional: (string), (string), (uuid), (string), (string), (object), (string), (string)
created_atdescriptionidip_addressnameportsrecord_typeupdated_atgo
globalIP, err := client.GlobalIPs.New(context.Background(), telnyx.GlobalIPNewParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIP.Data)Returns: (string), (string), (uuid), (string), (string), (object), (string), (string)
created_atdescriptionidip_addressnameportsrecord_typeupdated_at创建一个全局IP记录。
POST /global_ips可选参数:(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)、(字符串)
created_atdescriptionidip_addressnameportsrecord_typeupdated_atgo
globalIP, err := client.GlobalIPs.New(context.Background(), telnyx.GlobalIPNewParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIP.Data)返回参数:(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)、(字符串)
created_atdescriptionidip_addressnameportsrecord_typeupdated_atRetrieve a Global IP
查询全局IP
Retrieve a Global IP.
GET /global_ips/{id}go
globalIP, err := client.GlobalIPs.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIP.Data)Returns: (string), (string), (uuid), (string), (string), (object), (string), (string)
created_atdescriptionidip_addressnameportsrecord_typeupdated_at查询单个全局IP记录。
GET /global_ips/{id}go
globalIP, err := client.GlobalIPs.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIP.Data)返回参数:(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)、(字符串)
created_atdescriptionidip_addressnameportsrecord_typeupdated_atDelete a Global IP
删除全局IP
Delete a Global IP.
DELETE /global_ips/{id}go
globalIP, err := client.GlobalIPs.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIP.Data)Returns: (string), (string), (uuid), (string), (string), (object), (string), (string)
created_atdescriptionidip_addressnameportsrecord_typeupdated_at删除全局IP记录。
DELETE /global_ips/{id}go
globalIP, err := client.GlobalIPs.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", globalIP.Data)返回参数:(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)、(字符串)
created_atdescriptionidip_addressnameportsrecord_typeupdated_atList all Networks
列出所有网络
List all Networks.
GET /networksgo
page, err := client.Networks.List(context.Background(), telnyx.NetworkListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (string), (uuid), (string), (string), (string)
created_atidnamerecord_typeupdated_at列出所有网络记录。
GET /networksgo
page, err := client.Networks.List(context.Background(), telnyx.NetworkListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数:(字符串)、(uuid)、(字符串)、(字符串)、(字符串)
created_atidnamerecord_typeupdated_atCreate a Network
创建网络
Create a new Network.
POST /networksnameOptional: (string), (uuid), (string), (string)
created_atidrecord_typeupdated_atgo
network, err := client.Networks.New(context.Background(), telnyx.NetworkNewParams{
NetworkCreate: telnyx.NetworkCreateParam{
RecordParam: telnyx.RecordParam{},
Name: "test network",
},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", network.Data)Returns: (string), (uuid), (string), (string), (string)
created_atidnamerecord_typeupdated_at创建一个新网络。
POST /networksname可选参数:(字符串)、(uuid)、(字符串)、(字符串)
created_atidrecord_typeupdated_atgo
network, err := client.Networks.New(context.Background(), telnyx.NetworkNewParams{
NetworkCreate: telnyx.NetworkCreateParam{
RecordParam: telnyx.RecordParam{},
Name: "test network",
},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", network.Data)返回参数:(字符串)、(uuid)、(字符串)、(字符串)、(字符串)
created_atidnamerecord_typeupdated_atRetrieve a Network
查询网络
Retrieve a Network.
GET /networks/{id}go
network, err := client.Networks.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", network.Data)Returns: (string), (uuid), (string), (string), (string)
created_atidnamerecord_typeupdated_at查询单个网络记录。
GET /networks/{id}go
network, err := client.Networks.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", network.Data)返回参数:(字符串)、(uuid)、(字符串)、(字符串)、(字符串)
created_atidnamerecord_typeupdated_atUpdate a Network
更新网络
Update a Network.
PATCH /networks/{id}nameOptional: (string), (uuid), (string), (string)
created_atidrecord_typeupdated_atgo
network, err := client.Networks.Update(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.NetworkUpdateParams{
NetworkCreate: telnyx.NetworkCreateParam{
RecordParam: telnyx.RecordParam{},
Name: "test network",
},
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", network.Data)Returns: (string), (uuid), (string), (string), (string)
created_atidnamerecord_typeupdated_at更新网络记录。
PATCH /networks/{id}name可选参数:(字符串)、(uuid)、(字符串)、(字符串)
created_atidrecord_typeupdated_atgo
network, err := client.Networks.Update(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.NetworkUpdateParams{
NetworkCreate: telnyx.NetworkCreateParam{
RecordParam: telnyx.RecordParam{},
Name: "test network",
},
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", network.Data)返回参数:(字符串)、(uuid)、(字符串)、(字符串)、(字符串)
created_atidnamerecord_typeupdated_atDelete a Network
删除网络
Delete a Network.
DELETE /networks/{id}go
network, err := client.Networks.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", network.Data)Returns: (string), (uuid), (string), (string), (string)
created_atidnamerecord_typeupdated_at删除网络记录。
DELETE /networks/{id}go
network, err := client.Networks.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", network.Data)返回参数:(字符串)、(uuid)、(字符串)、(字符串)、(字符串)
created_atidnamerecord_typeupdated_atGet Default Gateway status.
获取默认网关状态
GET /networks/{id}/default_gatewaygo
defaultGateway, err := client.Networks.DefaultGateway.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", defaultGateway.Data)Returns: (string), (uuid), (uuid), (string), (enum: created, provisioning, provisioned, deleting), (string), (uuid)
created_atidnetwork_idrecord_typestatusupdated_atwireguard_peer_idGET /networks/{id}/default_gatewaygo
defaultGateway, err := client.Networks.DefaultGateway.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", defaultGateway.Data)返回参数:(字符串)、(uuid)、(uuid)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)、(uuid)
created_atidnetwork_idrecord_typestatusupdated_atwireguard_peer_idCreate Default Gateway.
创建默认网关
POST /networks/{id}/default_gatewayOptional: (string), (uuid), (uuid), (string), (enum: created, provisioning, provisioned, deleting), (string), (uuid)
created_atidnetwork_idrecord_typestatusupdated_atwireguard_peer_idgo
defaultGateway, err := client.Networks.DefaultGateway.New(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.NetworkDefaultGatewayNewParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", defaultGateway.Data)Returns: (string), (uuid), (uuid), (string), (enum: created, provisioning, provisioned, deleting), (string), (uuid)
created_atidnetwork_idrecord_typestatusupdated_atwireguard_peer_idPOST /networks/{id}/default_gateway可选参数:(字符串)、(uuid)、(uuid)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)、(uuid)
created_atidnetwork_idrecord_typestatusupdated_atwireguard_peer_idgo
defaultGateway, err := client.Networks.DefaultGateway.New(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.NetworkDefaultGatewayNewParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", defaultGateway.Data)返回参数:(字符串)、(uuid)、(uuid)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)、(uuid)
created_atidnetwork_idrecord_typestatusupdated_atwireguard_peer_idDelete Default Gateway.
删除默认网关
DELETE /networks/{id}/default_gatewaygo
defaultGateway, err := client.Networks.DefaultGateway.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", defaultGateway.Data)Returns: (string), (uuid), (uuid), (string), (enum: created, provisioning, provisioned, deleting), (string), (uuid)
created_atidnetwork_idrecord_typestatusupdated_atwireguard_peer_idDELETE /networks/{id}/default_gatewaygo
defaultGateway, err := client.Networks.DefaultGateway.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", defaultGateway.Data)返回参数:(字符串)、(uuid)、(uuid)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)、(uuid)
created_atidnetwork_idrecord_typestatusupdated_atwireguard_peer_idList all Interfaces for a Network.
列出网络的所有接口
GET /networks/{id}/network_interfacesgo
page, err := client.Networks.ListInterfaces(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.NetworkListInterfacesParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (string), (uuid), (string), (uuid), (string), (object), (string), (enum: created, provisioning, provisioned, deleting), (string), (string)
created_atidnamenetwork_idrecord_typeregionregion_codestatustypeupdated_atGET /networks/{id}/network_interfacesgo
page, err := client.Networks.ListInterfaces(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.NetworkListInterfacesParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数:(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(对象)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)、(字符串)
created_atidnamenetwork_idrecord_typeregionregion_codestatustypeupdated_atGet all Private Wireless Gateways
列出所有私有无线网关
Get all Private Wireless Gateways belonging to the user.
GET /private_wireless_gatewaysgo
page, err := client.PrivateWirelessGateways.List(context.Background(), telnyx.PrivateWirelessGatewayListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (array[object]), (string), (uuid), (string), (string), (uuid), (string), (string), (object), (string)
assigned_resourcescreated_atidip_rangenamenetwork_idrecord_typeregion_codestatusupdated_at获取用户名下所有私有无线网关。
GET /private_wireless_gatewaysgo
page, err := client.PrivateWirelessGateways.List(context.Background(), telnyx.PrivateWirelessGatewayListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数:(对象数组)、(字符串)、(uuid)、(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)
assigned_resourcescreated_atidip_rangenamenetwork_idrecord_typeregion_codestatusupdated_atCreate a Private Wireless Gateway
创建私有无线网关
Asynchronously create a Private Wireless Gateway for SIM cards for a previously created network. This operation may take several minutes so you can check the Private Wireless Gateway status at the section Get a Private Wireless Gateway.
POST /private_wireless_gatewaysnetwork_idnameOptional: (string)
region_codego
privateWirelessGateway, err := client.PrivateWirelessGateways.New(context.Background(), telnyx.PrivateWirelessGatewayNewParams{
Name: "My private wireless gateway",
NetworkID: "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", privateWirelessGateway.Data)Returns: (array[object]), (string), (uuid), (string), (string), (uuid), (string), (string), (object), (string)
assigned_resourcescreated_atidip_rangenamenetwork_idrecord_typeregion_codestatusupdated_at为已有网络的SIM卡异步创建私有无线网关。该操作可能需要几分钟,你可以通过「查询私有无线网关」接口查看创建状态。
POST /private_wireless_gatewaysnetwork_idname可选参数:(字符串)
region_codego
privateWirelessGateway, err := client.PrivateWirelessGateways.New(context.Background(), telnyx.PrivateWirelessGatewayNewParams{
Name: "My private wireless gateway",
NetworkID: "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", privateWirelessGateway.Data)返回参数:(对象数组)、(字符串)、(uuid)、(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)
assigned_resourcescreated_atidip_rangenamenetwork_idrecord_typeregion_codestatusupdated_atGet a Private Wireless Gateway
查询私有无线网关
Retrieve information about a Private Wireless Gateway.
GET /private_wireless_gateways/{id}go
privateWirelessGateway, err := client.PrivateWirelessGateways.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", privateWirelessGateway.Data)Returns: (array[object]), (string), (uuid), (string), (string), (uuid), (string), (string), (object), (string)
assigned_resourcescreated_atidip_rangenamenetwork_idrecord_typeregion_codestatusupdated_at查询私有无线网关的相关信息。
GET /private_wireless_gateways/{id}go
privateWirelessGateway, err := client.PrivateWirelessGateways.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", privateWirelessGateway.Data)返回参数:(对象数组)、(字符串)、(uuid)、(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)
assigned_resourcescreated_atidip_rangenamenetwork_idrecord_typeregion_codestatusupdated_atDelete a Private Wireless Gateway
删除私有无线网关
Deletes the Private Wireless Gateway.
DELETE /private_wireless_gateways/{id}go
privateWirelessGateway, err := client.PrivateWirelessGateways.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", privateWirelessGateway.Data)Returns: (array[object]), (string), (uuid), (string), (string), (uuid), (string), (string), (object), (string)
assigned_resourcescreated_atidip_rangenamenetwork_idrecord_typeregion_codestatusupdated_at删除私有无线网关。
DELETE /private_wireless_gateways/{id}go
privateWirelessGateway, err := client.PrivateWirelessGateways.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", privateWirelessGateway.Data)返回参数:(对象数组)、(字符串)、(uuid)、(字符串)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)
assigned_resourcescreated_atidip_rangenamenetwork_idrecord_typeregion_codestatusupdated_atList all Public Internet Gateways
列出所有公共互联网网关
List all Public Internet Gateways.
GET /public_internet_gatewaysgo
page, err := client.PublicInternetGateways.List(context.Background(), telnyx.PublicInternetGatewayListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (string), (uuid), (string), (uuid), (string), (string), (string), (enum: created, provisioning, provisioned, deleting), (string)
created_atidnamenetwork_idpublic_iprecord_typeregion_codestatusupdated_at列出所有公共互联网网关。
GET /public_internet_gatewaysgo
page, err := client.PublicInternetGateways.List(context.Background(), telnyx.PublicInternetGatewayListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数:(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
created_atidnamenetwork_idpublic_iprecord_typeregion_codestatusupdated_atCreate a Public Internet Gateway
创建公共互联网网关
Create a new Public Internet Gateway.
POST /public_internet_gatewaysOptional: (string), (uuid), (string), (uuid), (string), (string), (string), (enum: created, provisioning, provisioned, deleting), (string)
created_atidnamenetwork_idpublic_iprecord_typeregion_codestatusupdated_atgo
publicInternetGateway, err := client.PublicInternetGateways.New(context.Background(), telnyx.PublicInternetGatewayNewParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", publicInternetGateway.Data)Returns: (string), (uuid), (string), (uuid), (string), (string), (string), (enum: created, provisioning, provisioned, deleting), (string)
created_atidnamenetwork_idpublic_iprecord_typeregion_codestatusupdated_at创建一个新的公共互联网网关。
POST /public_internet_gateways可选参数:(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
created_atidnamenetwork_idpublic_iprecord_typeregion_codestatusupdated_atgo
publicInternetGateway, err := client.PublicInternetGateways.New(context.Background(), telnyx.PublicInternetGatewayNewParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", publicInternetGateway.Data)返回参数:(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
created_atidnamenetwork_idpublic_iprecord_typeregion_codestatusupdated_atRetrieve a Public Internet Gateway
查询公共互联网网关
Retrieve a Public Internet Gateway.
GET /public_internet_gateways/{id}go
publicInternetGateway, err := client.PublicInternetGateways.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", publicInternetGateway.Data)Returns: (string), (uuid), (string), (uuid), (string), (string), (string), (enum: created, provisioning, provisioned, deleting), (string)
created_atidnamenetwork_idpublic_iprecord_typeregion_codestatusupdated_at查询单个公共互联网网关。
GET /public_internet_gateways/{id}go
publicInternetGateway, err := client.PublicInternetGateways.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", publicInternetGateway.Data)返回参数:(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
created_atidnamenetwork_idpublic_iprecord_typeregion_codestatusupdated_atDelete a Public Internet Gateway
删除公共互联网网关
Delete a Public Internet Gateway.
DELETE /public_internet_gateways/{id}go
publicInternetGateway, err := client.PublicInternetGateways.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", publicInternetGateway.Data)Returns: (string), (uuid), (string), (uuid), (string), (string), (string), (enum: created, provisioning, provisioned, deleting), (string)
created_atidnamenetwork_idpublic_iprecord_typeregion_codestatusupdated_at删除公共互联网网关。
DELETE /public_internet_gateways/{id}go
publicInternetGateway, err := client.PublicInternetGateways.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", publicInternetGateway.Data)返回参数:(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
created_atidnamenetwork_idpublic_iprecord_typeregion_codestatusupdated_atList all Regions
列出所有区域
List all regions and the interfaces that region supports
GET /regionsgo
regions, err := client.Regions.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", regions.Data)Returns: (string), (string), (string), (string), (array[string]), (string)
codecreated_atnamerecord_typesupported_interfacesupdated_at列出所有区域及该区域支持的接口类型
GET /regionsgo
regions, err := client.Regions.List(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", regions.Data)返回参数:(字符串)、(字符串)、(字符串)、(字符串)、(字符串数组)、(字符串)
codecreated_atnamerecord_typesupported_interfacesupdated_atList all Virtual Cross Connects
列出所有虚拟交叉连接
List all Virtual Cross Connects.
GET /virtual_cross_connectsgo
page, err := client.VirtualCrossConnects.List(context.Background(), telnyx.VirtualCrossConnectListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (number), (number), (enum: aws, azure, gce), (string), (string), (uuid), (string), (uuid), (string), (string), (string), (boolean), (boolean), (string), (string), (object), (string), (string), (string), (string), (boolean), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string)
bandwidth_mbpsbgp_asncloud_providercloud_provider_regioncreated_atidnamenetwork_idprimary_bgp_keyprimary_cloud_account_idprimary_cloud_ipprimary_enabledprimary_routing_announcementprimary_telnyx_iprecord_typeregionregion_codesecondary_bgp_keysecondary_cloud_account_idsecondary_cloud_ipsecondary_enabledsecondary_routing_announcementsecondary_telnyx_ipstatusupdated_at列出所有虚拟交叉连接。
GET /virtual_cross_connectsgo
page, err := client.VirtualCrossConnects.List(context.Background(), telnyx.VirtualCrossConnectListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数:(数字)、(数字)、(枚举值:aws、azure、gce)、(字符串)、(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(布尔值)、(布尔值)、(字符串)、(字符串)、(对象)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
bandwidth_mbpsbgp_asncloud_providercloud_provider_regioncreated_atidnamenetwork_idprimary_bgp_keyprimary_cloud_account_idprimary_cloud_ipprimary_enabledprimary_routing_announcementprimary_telnyx_iprecord_typeregionregion_codesecondary_bgp_keysecondary_cloud_account_idsecondary_cloud_ipsecondary_enabledsecondary_routing_announcementsecondary_telnyx_ipstatusupdated_atCreate a Virtual Cross Connect
创建虚拟交叉连接
Create a new Virtual Cross Connect. For AWS and GCE, you have the option of creating the primary connection first and the secondary connection later. You also have the option of disabling the primary and/or secondary connections at any time and later re-enabling them. With Azure, you do not have this option.
POST /virtual_cross_connectsnetwork_idregion_codecloud_providercloud_provider_regionbgp_asnprimary_cloud_account_idOptional: (number), (string), (uuid), (string), (string), (string), (boolean), (string), (string), (string), (string), (string), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string)
bandwidth_mbpscreated_atidnameprimary_bgp_keyprimary_cloud_ipprimary_enabledprimary_telnyx_iprecord_typesecondary_bgp_keysecondary_cloud_account_idsecondary_cloud_ipsecondary_enabledsecondary_telnyx_ipstatusupdated_atgo
virtualCrossConnect, err := client.VirtualCrossConnects.New(context.Background(), telnyx.VirtualCrossConnectNewParams{
RegionCode: "ashburn-va",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", virtualCrossConnect.Data)Returns: (number), (number), (enum: aws, azure, gce), (string), (string), (uuid), (string), (uuid), (string), (string), (string), (boolean), (boolean), (string), (string), (object), (string), (string), (string), (string), (boolean), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string)
bandwidth_mbpsbgp_asncloud_providercloud_provider_regioncreated_atidnamenetwork_idprimary_bgp_keyprimary_cloud_account_idprimary_cloud_ipprimary_enabledprimary_routing_announcementprimary_telnyx_iprecord_typeregionregion_codesecondary_bgp_keysecondary_cloud_account_idsecondary_cloud_ipsecondary_enabledsecondary_routing_announcementsecondary_telnyx_ipstatusupdated_at创建一个新的虚拟交叉连接。对于AWS和GCE,你可以选择先创建主连接,之后再创建备连接,也可以随时禁用主/备连接之后再重新启用。Azure不支持该操作模式。
POST /virtual_cross_connectsnetwork_idregion_codecloud_providercloud_provider_regionbgp_asnprimary_cloud_account_id可选参数:(数字)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(布尔值)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
bandwidth_mbpscreated_atidnameprimary_bgp_keyprimary_cloud_ipprimary_enabledprimary_telnyx_iprecord_typesecondary_bgp_keysecondary_cloud_account_idsecondary_cloud_ipsecondary_enabledsecondary_telnyx_ipstatusupdated_atgo
virtualCrossConnect, err := client.VirtualCrossConnects.New(context.Background(), telnyx.VirtualCrossConnectNewParams{
RegionCode: "ashburn-va",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", virtualCrossConnect.Data)返回参数:(数字)、(数字)、(枚举值:aws、azure、gce)、(字符串)、(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(布尔值)、(布尔值)、(字符串)、(字符串)、(对象)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
bandwidth_mbpsbgp_asncloud_providercloud_provider_regioncreated_atidnamenetwork_idprimary_bgp_keyprimary_cloud_account_idprimary_cloud_ipprimary_enabledprimary_routing_announcementprimary_telnyx_iprecord_typeregionregion_codesecondary_bgp_keysecondary_cloud_account_idsecondary_cloud_ipsecondary_enabledsecondary_routing_announcementsecondary_telnyx_ipstatusupdated_atRetrieve a Virtual Cross Connect
查询虚拟交叉连接
Retrieve a Virtual Cross Connect.
GET /virtual_cross_connects/{id}go
virtualCrossConnect, err := client.VirtualCrossConnects.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", virtualCrossConnect.Data)Returns: (number), (number), (enum: aws, azure, gce), (string), (string), (uuid), (string), (uuid), (string), (string), (string), (boolean), (boolean), (string), (string), (object), (string), (string), (string), (string), (boolean), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string)
bandwidth_mbpsbgp_asncloud_providercloud_provider_regioncreated_atidnamenetwork_idprimary_bgp_keyprimary_cloud_account_idprimary_cloud_ipprimary_enabledprimary_routing_announcementprimary_telnyx_iprecord_typeregionregion_codesecondary_bgp_keysecondary_cloud_account_idsecondary_cloud_ipsecondary_enabledsecondary_routing_announcementsecondary_telnyx_ipstatusupdated_at查询单个虚拟交叉连接。
GET /virtual_cross_connects/{id}go
virtualCrossConnect, err := client.VirtualCrossConnects.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", virtualCrossConnect.Data)返回参数:(数字)、(数字)、(枚举值:aws、azure、gce)、(字符串)、(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(布尔值)、(布尔值)、(字符串)、(字符串)、(对象)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
bandwidth_mbpsbgp_asncloud_providercloud_provider_regioncreated_atidnamenetwork_idprimary_bgp_keyprimary_cloud_account_idprimary_cloud_ipprimary_enabledprimary_routing_announcementprimary_telnyx_iprecord_typeregionregion_codesecondary_bgp_keysecondary_cloud_account_idsecondary_cloud_ipsecondary_enabledsecondary_routing_announcementsecondary_telnyx_ipstatusupdated_atUpdate the Virtual Cross Connect
更新虚拟交叉连接
Update the Virtual Cross Connect. Cloud IPs can only be patched during the state, as GCE will only inform you of your generated IP once the pending connection requested has been accepted.
createdPATCH /virtual_cross_connects/{id}Optional: (string), (boolean), (boolean), (string), (boolean), (boolean)
primary_cloud_ipprimary_enabledprimary_routing_announcementsecondary_cloud_ipsecondary_enabledsecondary_routing_announcementgo
virtualCrossConnect, err := client.VirtualCrossConnects.Update(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.VirtualCrossConnectUpdateParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", virtualCrossConnect.Data)Returns: (number), (number), (enum: aws, azure, gce), (string), (string), (uuid), (string), (uuid), (string), (string), (string), (boolean), (boolean), (string), (string), (object), (string), (string), (string), (string), (boolean), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string)
bandwidth_mbpsbgp_asncloud_providercloud_provider_regioncreated_atidnamenetwork_idprimary_bgp_keyprimary_cloud_account_idprimary_cloud_ipprimary_enabledprimary_routing_announcementprimary_telnyx_iprecord_typeregionregion_codesecondary_bgp_keysecondary_cloud_account_idsecondary_cloud_ipsecondary_enabledsecondary_routing_announcementsecondary_telnyx_ipstatusupdated_at更新虚拟交叉连接。云IP仅能在状态下修改,因为GCE仅会在待处理的连接请求被接受后才会通知你生成的IP地址。
createdPATCH /virtual_cross_connects/{id}可选参数:(字符串)、(布尔值)、(布尔值)、(字符串)、(布尔值)、(布尔值)
primary_cloud_ipprimary_enabledprimary_routing_announcementsecondary_cloud_ipsecondary_enabledsecondary_routing_announcementgo
virtualCrossConnect, err := client.VirtualCrossConnects.Update(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.VirtualCrossConnectUpdateParams{},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", virtualCrossConnect.Data)返回参数:(数字)、(数字)、(枚举值:aws、azure、gce)、(字符串)、(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(布尔值)、(布尔值)、(字符串)、(字符串)、(对象)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
bandwidth_mbpsbgp_asncloud_providercloud_provider_regioncreated_atidnamenetwork_idprimary_bgp_keyprimary_cloud_account_idprimary_cloud_ipprimary_enabledprimary_routing_announcementprimary_telnyx_iprecord_typeregionregion_codesecondary_bgp_keysecondary_cloud_account_idsecondary_cloud_ipsecondary_enabledsecondary_routing_announcementsecondary_telnyx_ipstatusupdated_atDelete a Virtual Cross Connect
删除虚拟交叉连接
Delete a Virtual Cross Connect.
DELETE /virtual_cross_connects/{id}go
virtualCrossConnect, err := client.VirtualCrossConnects.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", virtualCrossConnect.Data)Returns: (number), (number), (enum: aws, azure, gce), (string), (string), (uuid), (string), (uuid), (string), (string), (string), (boolean), (boolean), (string), (string), (object), (string), (string), (string), (string), (boolean), (boolean), (string), (enum: created, provisioning, provisioned, deleting), (string)
bandwidth_mbpsbgp_asncloud_providercloud_provider_regioncreated_atidnamenetwork_idprimary_bgp_keyprimary_cloud_account_idprimary_cloud_ipprimary_enabledprimary_routing_announcementprimary_telnyx_iprecord_typeregionregion_codesecondary_bgp_keysecondary_cloud_account_idsecondary_cloud_ipsecondary_enabledsecondary_routing_announcementsecondary_telnyx_ipstatusupdated_at删除虚拟交叉连接。
DELETE /virtual_cross_connects/{id}go
virtualCrossConnect, err := client.VirtualCrossConnects.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", virtualCrossConnect.Data)返回参数:(数字)、(数字)、(枚举值:aws、azure、gce)、(字符串)、(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(布尔值)、(布尔值)、(字符串)、(字符串)、(对象)、(字符串)、(字符串)、(字符串)、(字符串)、(布尔值)、(布尔值)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
bandwidth_mbpsbgp_asncloud_providercloud_provider_regioncreated_atidnamenetwork_idprimary_bgp_keyprimary_cloud_account_idprimary_cloud_ipprimary_enabledprimary_routing_announcementprimary_telnyx_iprecord_typeregionregion_codesecondary_bgp_keysecondary_cloud_account_idsecondary_cloud_ipsecondary_enabledsecondary_routing_announcementsecondary_telnyx_ipstatusupdated_atList Virtual Cross Connect Cloud Coverage
列出虚拟交叉连接云覆盖区域
List Virtual Cross Connects Cloud Coverage. This endpoint shows which cloud regions are available for the your Virtual Cross Connect will be provisioned in.
location_codeGET /virtual_cross_connects_coveragego
page, err := client.VirtualCrossConnectsCoverage.List(context.Background(), telnyx.VirtualCrossConnectsCoverageListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (array[number]), (enum: aws, azure, gce), (string), (object), (string)
available_bandwidthcloud_providercloud_provider_regionlocationrecord_type列出虚拟交叉连接的云覆盖区域。该接口会返回你要部署虚拟交叉连接的对应的可用云区域。
location_codeGET /virtual_cross_connects_coveragego
page, err := client.VirtualCrossConnectsCoverage.List(context.Background(), telnyx.VirtualCrossConnectsCoverageListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数:(数字数组)、(枚举值:aws、azure、gce)、(字符串)、(对象)、(字符串)
available_bandwidthcloud_providercloud_provider_regionlocationrecord_typeList all WireGuard Interfaces
列出所有WireGuard接口
List all WireGuard Interfaces.
GET /wireguard_interfacesgo
page, err := client.WireguardInterfaces.List(context.Background(), telnyx.WireguardInterfaceListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (string), (boolean), (string), (uuid), (string), (uuid), (string), (string), (object), (string), (enum: created, provisioning, provisioned, deleting), (string)
created_atenable_sip_trunkingendpointidnamenetwork_idpublic_keyrecord_typeregionregion_codestatusupdated_at列出所有WireGuard接口。
GET /wireguard_interfacesgo
page, err := client.WireguardInterfaces.List(context.Background(), telnyx.WireguardInterfaceListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数:(字符串)、(布尔值)、(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
created_atenable_sip_trunkingendpointidnamenetwork_idpublic_keyrecord_typeregionregion_codestatusupdated_atCreate a WireGuard Interface
创建WireGuard接口
Create a new WireGuard Interface. Current limitation of 10 interfaces per user can be created.
POST /wireguard_interfacesnetwork_idregion_codeOptional: (string), (boolean), (string), (uuid), (string), (string), (string), (enum: created, provisioning, provisioned, deleting), (string)
created_atenable_sip_trunkingendpointidnamepublic_keyrecord_typestatusupdated_atgo
wireguardInterface, err := client.WireguardInterfaces.New(context.Background(), telnyx.WireguardInterfaceNewParams{
RegionCode: "ashburn-va",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardInterface.Data)Returns: (string), (boolean), (string), (uuid), (string), (uuid), (string), (string), (object), (string), (enum: created, provisioning, provisioned, deleting), (string)
created_atenable_sip_trunkingendpointidnamenetwork_idpublic_keyrecord_typeregionregion_codestatusupdated_at创建一个新的WireGuard接口。当前限制每个用户最多可创建10个接口。
POST /wireguard_interfacesnetwork_idregion_code可选参数:(字符串)、(布尔值)、(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
created_atenable_sip_trunkingendpointidnamepublic_keyrecord_typestatusupdated_atgo
wireguardInterface, err := client.WireguardInterfaces.New(context.Background(), telnyx.WireguardInterfaceNewParams{
RegionCode: "ashburn-va",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardInterface.Data)返回参数:(字符串)、(布尔值)、(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
created_atenable_sip_trunkingendpointidnamenetwork_idpublic_keyrecord_typeregionregion_codestatusupdated_atRetrieve a WireGuard Interfaces
查询WireGuard接口
Retrieve a WireGuard Interfaces.
GET /wireguard_interfaces/{id}go
wireguardInterface, err := client.WireguardInterfaces.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardInterface.Data)Returns: (string), (boolean), (string), (uuid), (string), (uuid), (string), (string), (object), (string), (enum: created, provisioning, provisioned, deleting), (string)
created_atenable_sip_trunkingendpointidnamenetwork_idpublic_keyrecord_typeregionregion_codestatusupdated_at查询单个WireGuard接口。
GET /wireguard_interfaces/{id}go
wireguardInterface, err := client.WireguardInterfaces.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardInterface.Data)返回参数:(字符串)、(布尔值)、(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
created_atenable_sip_trunkingendpointidnamenetwork_idpublic_keyrecord_typeregionregion_codestatusupdated_atDelete a WireGuard Interface
删除WireGuard接口
Delete a WireGuard Interface.
DELETE /wireguard_interfaces/{id}go
wireguardInterface, err := client.WireguardInterfaces.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardInterface.Data)Returns: (string), (boolean), (string), (uuid), (string), (uuid), (string), (string), (object), (string), (enum: created, provisioning, provisioned, deleting), (string)
created_atenable_sip_trunkingendpointidnamenetwork_idpublic_keyrecord_typeregionregion_codestatusupdated_at删除WireGuard接口。
DELETE /wireguard_interfaces/{id}go
wireguardInterface, err := client.WireguardInterfaces.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardInterface.Data)返回参数:(字符串)、(布尔值)、(字符串)、(uuid)、(字符串)、(uuid)、(字符串)、(字符串)、(对象)、(字符串)、(枚举值:created、provisioning、provisioned、deleting)、(字符串)
created_atenable_sip_trunkingendpointidnamenetwork_idpublic_keyrecord_typeregionregion_codestatusupdated_atList all WireGuard Peers
列出所有WireGuard对等节点
List all WireGuard peers.
GET /wireguard_peersgo
page, err := client.WireguardPeers.List(context.Background(), telnyx.WireguardPeerListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)Returns: (string), (uuid), (string), (string), (string), (string), (string), (uuid)
created_atidlast_seenprivate_keypublic_keyrecord_typeupdated_atwireguard_interface_id列出所有WireGuard对等节点。
GET /wireguard_peersgo
page, err := client.WireguardPeers.List(context.Background(), telnyx.WireguardPeerListParams{})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", page)返回参数:(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(uuid)
created_atidlast_seenprivate_keypublic_keyrecord_typeupdated_atwireguard_interface_idCreate a WireGuard Peer
创建WireGuard对等节点
Create a new WireGuard Peer. Current limitation of 5 peers per interface can be created.
POST /wireguard_peerswireguard_interface_idOptional: (string), (uuid), (string), (string), (string), (string), (string)
created_atidlast_seenprivate_keypublic_keyrecord_typeupdated_atgo
wireguardPeer, err := client.WireguardPeers.New(context.Background(), telnyx.WireguardPeerNewParams{
WireguardInterfaceID: "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardPeer.Data)Returns: (string), (uuid), (string), (string), (string), (string), (string), (uuid)
created_atidlast_seenprivate_keypublic_keyrecord_typeupdated_atwireguard_interface_id创建一个新的WireGuard对等节点。当前限制每个接口最多可创建5个对等节点。
POST /wireguard_peerswireguard_interface_id可选参数:(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)
created_atidlast_seenprivate_keypublic_keyrecord_typeupdated_atgo
wireguardPeer, err := client.WireguardPeers.New(context.Background(), telnyx.WireguardPeerNewParams{
WireguardInterfaceID: "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardPeer.Data)返回参数:(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(uuid)
created_atidlast_seenprivate_keypublic_keyrecord_typeupdated_atwireguard_interface_idRetrieve the WireGuard Peer
查询WireGuard对等节点
Retrieve the WireGuard peer.
GET /wireguard_peers/{id}go
wireguardPeer, err := client.WireguardPeers.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardPeer.Data)Returns: (string), (uuid), (string), (string), (string), (string), (string), (uuid)
created_atidlast_seenprivate_keypublic_keyrecord_typeupdated_atwireguard_interface_id查询单个WireGuard对等节点。
GET /wireguard_peers/{id}go
wireguardPeer, err := client.WireguardPeers.Get(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardPeer.Data)返回参数:(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(uuid)
created_atidlast_seenprivate_keypublic_keyrecord_typeupdated_atwireguard_interface_idUpdate the WireGuard Peer
更新WireGuard对等节点
Update the WireGuard peer.
PATCH /wireguard_peers/{id}Optional: (string)
public_keygo
wireguardPeer, err := client.WireguardPeers.Update(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.WireguardPeerUpdateParams{
WireguardPeerPatch: telnyx.WireguardPeerPatchParam{},
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardPeer.Data)Returns: (string), (uuid), (string), (string), (string), (string), (string), (uuid)
created_atidlast_seenprivate_keypublic_keyrecord_typeupdated_atwireguard_interface_id更新WireGuard对等节点。
PATCH /wireguard_peers/{id}可选参数:(字符串)
public_keygo
wireguardPeer, err := client.WireguardPeers.Update(
context.Background(),
"6a09cdc3-8948-47f0-aa62-74ac943d6c58",
telnyx.WireguardPeerUpdateParams{
WireguardPeerPatch: telnyx.WireguardPeerPatchParam{},
},
)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardPeer.Data)返回参数:(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(uuid)
created_atidlast_seenprivate_keypublic_keyrecord_typeupdated_atwireguard_interface_idDelete the WireGuard Peer
删除WireGuard对等节点
Delete the WireGuard peer.
DELETE /wireguard_peers/{id}go
wireguardPeer, err := client.WireguardPeers.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardPeer.Data)Returns: (string), (uuid), (string), (string), (string), (string), (string), (uuid)
created_atidlast_seenprivate_keypublic_keyrecord_typeupdated_atwireguard_interface_id删除WireGuard对等节点。
DELETE /wireguard_peers/{id}go
wireguardPeer, err := client.WireguardPeers.Delete(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", wireguardPeer.Data)返回参数:(字符串)、(uuid)、(字符串)、(字符串)、(字符串)、(字符串)、(字符串)、(uuid)
created_atidlast_seenprivate_keypublic_keyrecord_typeupdated_atwireguard_interface_idRetrieve Wireguard config template for Peer
获取对等节点的WireGuard配置模板
GET /wireguard_peers/{id}/configgo
response, err := client.WireguardPeers.GetConfig(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response)GET /wireguard_peers/{id}/configgo
response, err := client.WireguardPeers.GetConfig(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", response)