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-go
bash
go get github.com/team-telnyx/telnyx-go

Setup

配置

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
client
is already initialized as shown above.
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")),
)
以下所有示例均假设
client
已按照上述方式完成初始化。

Error 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:
401
invalid API key,
403
insufficient permissions,
404
resource not found,
422
validation error (check field formats),
429
rate limited (retry with exponential backoff).
所有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("网络错误 — 请检查网络连接后重试")
  }
}
常见错误码:
401
API密钥无效,
403
权限不足,
404
资源不存在,
422
校验错误(检查字段格式),
429
触发速率限制(按指数退避策略重试)。

Important Notes

注意事项

  • Pagination: Use
    ListAutoPaging()
    for automatic iteration:
    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/clusters
go
	page, err := client.AI.Clusters.List(context.Background(), telnyx.AIClusterListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
Returns:
bucket
(string),
created_at
(date-time),
finished_at
(date-time),
min_cluster_size
(integer),
min_subcluster_size
(integer),
status
(enum: pending, starting, running, completed, failed),
task_id
(string)
GET /ai/clusters
go
	page, err := client.AI.Clusters.List(context.Background(), telnyx.AIClusterListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
返回参数:
bucket
(字符串)、
created_at
(日期时间)、
finished_at
(日期时间)、
min_cluster_size
(整数)、
min_subcluster_size
(整数)、
status
(枚举值:pending、starting、running、completed、failed)、
task_id
(字符串)

Compute 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/clusters
— Required:
bucket
Optional:
files
(array[string]),
min_cluster_size
(integer),
min_subcluster_size
(integer),
prefix
(string)
go
	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:
task_id
(string)
启动一个后台任务,计算嵌入式存储桶中的数据的聚类方式。该功能可帮助识别数据中的通用主题和模式。
POST /ai/clusters
— 必填参数:
bucket
可选参数:
files
(字符串数组)、
min_cluster_size
(整数)、
min_subcluster_size
(整数)、
prefix
(字符串)
go
	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_id
(字符串)

Fetch 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:
bucket
(string),
clusters
(array[object]),
status
(enum: pending, starting, running, completed, failed)
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)
返回参数:
bucket
(字符串)、
clusters
(对象数组)、
status
(枚举值:pending、starting、running、completed、failed)

Delete 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}/graph
go
	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}/graph
go
	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/integrations
go
	integrations, err := client.AI.Integrations.List(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", integrations.Data)
Returns:
available_tools
(array[string]),
description
(string),
display_name
(string),
id
(string),
logo_url
(string),
name
(string),
status
(enum: disconnected, connected)
列出所有可用的集成。
GET /ai/integrations
go
	integrations, err := client.AI.Integrations.List(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", integrations.Data)
返回参数:
available_tools
(字符串数组)、
description
(字符串)、
display_name
(字符串)、
id
(字符串)、
logo_url
(字符串)、
name
(字符串)、
status
(枚举值:disconnected、connected)

List User Integrations

列出用户集成

List user setup integrations
GET /ai/integrations/connections
go
	connections, err := client.AI.Integrations.Connections.List(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", connections.Data)
Returns:
allowed_tools
(array[string]),
id
(string),
integration_id
(string)
列出用户已配置的集成
GET /ai/integrations/connections
go
	connections, err := client.AI.Integrations.Connections.List(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", connections.Data)
返回参数:
allowed_tools
(字符串数组)、
id
(字符串)、
integration_id
(字符串)

Get 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:
allowed_tools
(array[string]),
id
(string),
integration_id
(string)
获取用户已配置的集成
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_tools
(字符串数组)、
id
(字符串)、
integration_id
(字符串)

Delete 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:
available_tools
(array[string]),
description
(string),
display_name
(string),
id
(string),
logo_url
(string),
name
(string),
status
(enum: disconnected, connected)
查询集成详情
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)
返回参数:
available_tools
(字符串数组)、
description
(字符串)、
display_name
(字符串)、
id
(字符串)、
logo_url
(字符串)、
name
(字符串)、
status
(枚举值:disconnected、connected)

List all Global IP Allowed Ports

列出所有全局IP允许端口

GET /global_ip_allowed_ports
go
	globalIPAllowedPorts, err := client.GlobalIPAllowedPorts.List(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPAllowedPorts.Data)
Returns:
first_port
(integer),
id
(uuid),
last_port
(integer),
name
(string),
protocol_code
(string),
record_type
(string)
GET /global_ip_allowed_ports
go
	globalIPAllowedPorts, err := client.GlobalIPAllowedPorts.List(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPAllowedPorts.Data)
返回参数:
first_port
(整数)、
id
(uuid)、
last_port
(整数)、
name
(字符串)、
protocol_code
(字符串)、
record_type
(字符串)

Global IP Assignment Health Check Metrics

全局IP分配健康检查指标

GET /global_ip_assignment_health
go
	globalIPAssignmentHealth, err := client.GlobalIPAssignmentHealth.Get(context.Background(), telnyx.GlobalIPAssignmentHealthGetParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPAssignmentHealth.Data)
Returns:
global_ip
(object),
global_ip_assignment
(object),
health
(object),
timestamp
(date-time)
GET /global_ip_assignment_health
go
	globalIPAssignmentHealth, err := client.GlobalIPAssignmentHealth.Get(context.Background(), telnyx.GlobalIPAssignmentHealthGetParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPAssignmentHealth.Data)
返回参数:
global_ip
(对象)、
global_ip_assignment
(对象)、
health
(对象)、
timestamp
(日期时间)

List all Global IP assignments

列出所有全局IP分配

List all Global IP assignments.
GET /global_ip_assignments
go
	page, err := client.GlobalIPAssignments.List(context.Background(), telnyx.GlobalIPAssignmentListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
Returns:
created_at
(string),
global_ip_id
(uuid),
id
(uuid),
is_announced
(boolean),
is_connected
(boolean),
is_in_maintenance
(boolean),
record_type
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string),
wireguard_peer_id
(uuid)
列出所有全局IP分配记录。
GET /global_ip_assignments
go
	page, err := client.GlobalIPAssignments.List(context.Background(), telnyx.GlobalIPAssignmentListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
返回参数:
created_at
(字符串)、
global_ip_id
(uuid)、
id
(uuid)、
is_announced
(布尔值)、
is_connected
(布尔值)、
is_in_maintenance
(布尔值)、
record_type
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)、
wireguard_peer_id
(uuid)

Create a Global IP assignment

创建全局IP分配

Create a Global IP assignment.
POST /global_ip_assignments
Optional:
created_at
(string),
global_ip_id
(uuid),
id
(uuid),
is_announced
(boolean),
is_connected
(boolean),
is_in_maintenance
(boolean),
record_type
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string),
wireguard_peer_id
(uuid)
go
	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:
created_at
(string),
global_ip_id
(uuid),
id
(uuid),
is_announced
(boolean),
is_connected
(boolean),
is_in_maintenance
(boolean),
record_type
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string),
wireguard_peer_id
(uuid)
创建一个全局IP分配记录。
POST /global_ip_assignments
可选参数:
created_at
(字符串)、
global_ip_id
(uuid)、
id
(uuid)、
is_announced
(布尔值)、
is_connected
(布尔值)、
is_in_maintenance
(布尔值)、
record_type
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)、
wireguard_peer_id
(uuid)
go
	globalIPAssignment, err := client.GlobalIPAssignments.New(context.Background(), telnyx.GlobalIPAssignmentNewParams{
		GlobalIPAssignment: telnyx.GlobalIPAssignmentParam{},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPAssignment.Data)
返回参数:
created_at
(字符串)、
global_ip_id
(uuid)、
id
(uuid)、
is_announced
(布尔值)、
is_connected
(布尔值)、
is_in_maintenance
(布尔值)、
record_type
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)、
wireguard_peer_id
(uuid)

Retrieve 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:
created_at
(string),
global_ip_id
(uuid),
id
(uuid),
is_announced
(boolean),
is_connected
(boolean),
is_in_maintenance
(boolean),
record_type
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string),
wireguard_peer_id
(uuid)
查询单个全局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)
返回参数:
created_at
(字符串)、
global_ip_id
(uuid)、
id
(uuid)、
is_announced
(布尔值)、
is_connected
(布尔值)、
is_in_maintenance
(布尔值)、
record_type
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)、
wireguard_peer_id
(uuid)

Update a Global IP assignment

更新全局IP分配

Update a Global IP assignment.
PATCH /global_ip_assignments/{id}
Optional:
created_at
(string),
global_ip_id
(string),
id
(uuid),
is_announced
(boolean),
is_connected
(boolean),
is_in_maintenance
(boolean),
record_type
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string),
wireguard_peer_id
(string)
go
	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:
created_at
(string),
global_ip_id
(uuid),
id
(uuid),
is_announced
(boolean),
is_connected
(boolean),
is_in_maintenance
(boolean),
record_type
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string),
wireguard_peer_id
(uuid)
更新全局IP分配记录。
PATCH /global_ip_assignments/{id}
可选参数:
created_at
(字符串)、
global_ip_id
(字符串)、
id
(uuid)、
is_announced
(布尔值)、
is_connected
(布尔值)、
is_in_maintenance
(布尔值)、
record_type
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)、
wireguard_peer_id
(字符串)
go
	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)
返回参数:
created_at
(字符串)、
global_ip_id
(uuid)、
id
(uuid)、
is_announced
(布尔值)、
is_connected
(布尔值)、
is_in_maintenance
(布尔值)、
record_type
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)、
wireguard_peer_id
(uuid)

Delete 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:
created_at
(string),
global_ip_id
(uuid),
id
(uuid),
is_announced
(boolean),
is_connected
(boolean),
is_in_maintenance
(boolean),
record_type
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string),
wireguard_peer_id
(uuid)
删除全局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)
返回参数:
created_at
(字符串)、
global_ip_id
(uuid)、
id
(uuid)、
is_announced
(布尔值)、
is_connected
(布尔值)、
is_in_maintenance
(布尔值)、
record_type
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)、
wireguard_peer_id
(uuid)

Global IP Assignment Usage Metrics

全局IP分配使用指标

GET /global_ip_assignments_usage
go
	globalIPAssignmentsUsage, err := client.GlobalIPAssignmentsUsage.Get(context.Background(), telnyx.GlobalIPAssignmentsUsageGetParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPAssignmentsUsage.Data)
Returns:
global_ip
(object),
global_ip_assignment
(object),
received
(object),
timestamp
(date-time),
transmitted
(object)
GET /global_ip_assignments_usage
go
	globalIPAssignmentsUsage, err := client.GlobalIPAssignmentsUsage.Get(context.Background(), telnyx.GlobalIPAssignmentsUsageGetParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPAssignmentsUsage.Data)
返回参数:
global_ip
(对象)、
global_ip_assignment
(对象)、
received
(对象)、
timestamp
(日期时间)、
transmitted
(对象)

List all Global IP Health check types

列出所有全局IP健康检查类型

List all Global IP Health check types.
GET /global_ip_health_check_types
go
	globalIPHealthCheckTypes, err := client.GlobalIPHealthCheckTypes.List(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPHealthCheckTypes.Data)
Returns:
health_check_params
(object),
health_check_type
(string),
record_type
(string)
列出所有全局IP健康检查类型。
GET /global_ip_health_check_types
go
	globalIPHealthCheckTypes, err := client.GlobalIPHealthCheckTypes.List(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPHealthCheckTypes.Data)
返回参数:
health_check_params
(对象)、
health_check_type
(字符串)、
record_type
(字符串)

List all Global IP health checks

列出所有全局IP健康检查

List all Global IP health checks.
GET /global_ip_health_checks
go
	page, err := client.GlobalIPHealthChecks.List(context.Background(), telnyx.GlobalIPHealthCheckListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
Returns:
created_at
(string),
global_ip_id
(uuid),
health_check_params
(object),
health_check_type
(string),
id
(uuid),
record_type
(string),
updated_at
(string)
列出所有全局IP健康检查记录。
GET /global_ip_health_checks
go
	page, err := client.GlobalIPHealthChecks.List(context.Background(), telnyx.GlobalIPHealthCheckListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
返回参数:
created_at
(字符串)、
global_ip_id
(uuid)、
health_check_params
(对象)、
health_check_type
(字符串)、
id
(uuid)、
record_type
(字符串)、
updated_at
(字符串)

Create a Global IP health check

创建全局IP健康检查

Create a Global IP health check.
POST /global_ip_health_checks
Optional:
created_at
(string),
global_ip_id
(uuid),
health_check_params
(object),
health_check_type
(string),
id
(uuid),
record_type
(string),
updated_at
(string)
go
	globalIPHealthCheck, err := client.GlobalIPHealthChecks.New(context.Background(), telnyx.GlobalIPHealthCheckNewParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPHealthCheck.Data)
Returns:
created_at
(string),
global_ip_id
(uuid),
health_check_params
(object),
health_check_type
(string),
id
(uuid),
record_type
(string),
updated_at
(string)
创建全局IP健康检查记录。
POST /global_ip_health_checks
可选参数:
created_at
(字符串)、
global_ip_id
(uuid)、
health_check_params
(对象)、
health_check_type
(字符串)、
id
(uuid)、
record_type
(字符串)、
updated_at
(字符串)
go
	globalIPHealthCheck, err := client.GlobalIPHealthChecks.New(context.Background(), telnyx.GlobalIPHealthCheckNewParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPHealthCheck.Data)
返回参数:
created_at
(字符串)、
global_ip_id
(uuid)、
health_check_params
(对象)、
health_check_type
(字符串)、
id
(uuid)、
record_type
(字符串)、
updated_at
(字符串)

Retrieve 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:
created_at
(string),
global_ip_id
(uuid),
health_check_params
(object),
health_check_type
(string),
id
(uuid),
record_type
(string),
updated_at
(string)
查询单个全局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)
返回参数:
created_at
(字符串)、
global_ip_id
(uuid)、
health_check_params
(对象)、
health_check_type
(字符串)、
id
(uuid)、
record_type
(字符串)、
updated_at
(字符串)

Delete 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:
created_at
(string),
global_ip_id
(uuid),
health_check_params
(object),
health_check_type
(string),
id
(uuid),
record_type
(string),
updated_at
(string)
删除全局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)
返回参数:
created_at
(字符串)、
global_ip_id
(uuid)、
health_check_params
(对象)、
health_check_type
(字符串)、
id
(uuid)、
record_type
(字符串)、
updated_at
(字符串)

Global IP Latency Metrics

全局IP延迟指标

GET /global_ip_latency
go
	globalIPLatency, err := client.GlobalIPLatency.Get(context.Background(), telnyx.GlobalIPLatencyGetParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPLatency.Data)
Returns:
global_ip
(object),
mean_latency
(object),
percentile_latency
(object),
prober_location
(object),
timestamp
(date-time)
GET /global_ip_latency
go
	globalIPLatency, err := client.GlobalIPLatency.Get(context.Background(), telnyx.GlobalIPLatencyGetParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPLatency.Data)
返回参数:
global_ip
(对象)、
mean_latency
(对象)、
percentile_latency
(对象)、
prober_location
(对象)、
timestamp
(日期时间)

List all Global IP Protocols

列出所有全局IP协议

GET /global_ip_protocols
go
	globalIPProtocols, err := client.GlobalIPProtocols.List(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPProtocols.Data)
Returns:
code
(string),
name
(string),
record_type
(string)
GET /global_ip_protocols
go
	globalIPProtocols, err := client.GlobalIPProtocols.List(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPProtocols.Data)
返回参数:
code
(字符串)、
name
(字符串)、
record_type
(字符串)

Global IP Usage Metrics

全局IP使用指标

GET /global_ip_usage
go
	globalIPUsage, err := client.GlobalIPUsage.Get(context.Background(), telnyx.GlobalIPUsageGetParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPUsage.Data)
Returns:
global_ip
(object),
received
(object),
timestamp
(date-time),
transmitted
(object)
GET /global_ip_usage
go
	globalIPUsage, err := client.GlobalIPUsage.Get(context.Background(), telnyx.GlobalIPUsageGetParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIPUsage.Data)
返回参数:
global_ip
(对象)、
received
(对象)、
timestamp
(日期时间)、
transmitted
(对象)

List all Global IPs

列出所有全局IP

List all Global IPs.
GET /global_ips
go
	page, err := client.GlobalIPs.List(context.Background(), telnyx.GlobalIPListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
Returns:
created_at
(string),
description
(string),
id
(uuid),
ip_address
(string),
name
(string),
ports
(object),
record_type
(string),
updated_at
(string)
列出所有全局IP记录。
GET /global_ips
go
	page, err := client.GlobalIPs.List(context.Background(), telnyx.GlobalIPListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
返回参数:
created_at
(字符串)、
description
(字符串)、
id
(uuid)、
ip_address
(字符串)、
name
(字符串)、
ports
(对象)、
record_type
(字符串)、
updated_at
(字符串)

Create a Global IP

创建全局IP

Create a Global IP.
POST /global_ips
Optional:
created_at
(string),
description
(string),
id
(uuid),
ip_address
(string),
name
(string),
ports
(object),
record_type
(string),
updated_at
(string)
go
	globalIP, err := client.GlobalIPs.New(context.Background(), telnyx.GlobalIPNewParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIP.Data)
Returns:
created_at
(string),
description
(string),
id
(uuid),
ip_address
(string),
name
(string),
ports
(object),
record_type
(string),
updated_at
(string)
创建一个全局IP记录。
POST /global_ips
可选参数:
created_at
(字符串)、
description
(字符串)、
id
(uuid)、
ip_address
(字符串)、
name
(字符串)、
ports
(对象)、
record_type
(字符串)、
updated_at
(字符串)
go
	globalIP, err := client.GlobalIPs.New(context.Background(), telnyx.GlobalIPNewParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", globalIP.Data)
返回参数:
created_at
(字符串)、
description
(字符串)、
id
(uuid)、
ip_address
(字符串)、
name
(字符串)、
ports
(对象)、
record_type
(字符串)、
updated_at
(字符串)

Retrieve 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:
created_at
(string),
description
(string),
id
(uuid),
ip_address
(string),
name
(string),
ports
(object),
record_type
(string),
updated_at
(string)
查询单个全局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)
返回参数:
created_at
(字符串)、
description
(字符串)、
id
(uuid)、
ip_address
(字符串)、
name
(字符串)、
ports
(对象)、
record_type
(字符串)、
updated_at
(字符串)

Delete 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:
created_at
(string),
description
(string),
id
(uuid),
ip_address
(string),
name
(string),
ports
(object),
record_type
(string),
updated_at
(string)
删除全局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)
返回参数:
created_at
(字符串)、
description
(字符串)、
id
(uuid)、
ip_address
(字符串)、
name
(字符串)、
ports
(对象)、
record_type
(字符串)、
updated_at
(字符串)

List all Networks

列出所有网络

List all Networks.
GET /networks
go
	page, err := client.Networks.List(context.Background(), telnyx.NetworkListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
Returns:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
updated_at
(string)
列出所有网络记录。
GET /networks
go
	page, err := client.Networks.List(context.Background(), telnyx.NetworkListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
返回参数:
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
record_type
(字符串)、
updated_at
(字符串)

Create a Network

创建网络

Create a new Network.
POST /networks
— Required:
name
Optional:
created_at
(string),
id
(uuid),
record_type
(string),
updated_at
(string)
go
	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:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
updated_at
(string)
创建一个新网络。
POST /networks
— 必填参数:
name
可选参数:
created_at
(字符串)、
id
(uuid)、
record_type
(字符串)、
updated_at
(字符串)
go
	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)
返回参数:
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
record_type
(字符串)、
updated_at
(字符串)

Retrieve 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:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
updated_at
(string)
查询单个网络记录。
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)
返回参数:
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
record_type
(字符串)、
updated_at
(字符串)

Update a Network

更新网络

Update a Network.
PATCH /networks/{id}
— Required:
name
Optional:
created_at
(string),
id
(uuid),
record_type
(string),
updated_at
(string)
go
	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:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
updated_at
(string)
更新网络记录。
PATCH /networks/{id}
— 必填参数:
name
可选参数:
created_at
(字符串)、
id
(uuid)、
record_type
(字符串)、
updated_at
(字符串)
go
	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)
返回参数:
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
record_type
(字符串)、
updated_at
(字符串)

Delete 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:
created_at
(string),
id
(uuid),
name
(string),
record_type
(string),
updated_at
(string)
删除网络记录。
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)
返回参数:
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
record_type
(字符串)、
updated_at
(字符串)

Get Default Gateway status.

获取默认网关状态

GET /networks/{id}/default_gateway
go
	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:
created_at
(string),
id
(uuid),
network_id
(uuid),
record_type
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string),
wireguard_peer_id
(uuid)
GET /networks/{id}/default_gateway
go
	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)
返回参数:
created_at
(字符串)、
id
(uuid)、
network_id
(uuid)、
record_type
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)、
wireguard_peer_id
(uuid)

Create Default Gateway.

创建默认网关

POST /networks/{id}/default_gateway
Optional:
created_at
(string),
id
(uuid),
network_id
(uuid),
record_type
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string),
wireguard_peer_id
(uuid)
go
	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:
created_at
(string),
id
(uuid),
network_id
(uuid),
record_type
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string),
wireguard_peer_id
(uuid)
POST /networks/{id}/default_gateway
可选参数:
created_at
(字符串)、
id
(uuid)、
network_id
(uuid)、
record_type
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)、
wireguard_peer_id
(uuid)
go
	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)
返回参数:
created_at
(字符串)、
id
(uuid)、
network_id
(uuid)、
record_type
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)、
wireguard_peer_id
(uuid)

Delete Default Gateway.

删除默认网关

DELETE /networks/{id}/default_gateway
go
	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:
created_at
(string),
id
(uuid),
network_id
(uuid),
record_type
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string),
wireguard_peer_id
(uuid)
DELETE /networks/{id}/default_gateway
go
	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)
返回参数:
created_at
(字符串)、
id
(uuid)、
network_id
(uuid)、
record_type
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)、
wireguard_peer_id
(uuid)

List all Interfaces for a Network.

列出网络的所有接口

GET /networks/{id}/network_interfaces
go
	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:
created_at
(string),
id
(uuid),
name
(string),
network_id
(uuid),
record_type
(string),
region
(object),
region_code
(string),
status
(enum: created, provisioning, provisioned, deleting),
type
(string),
updated_at
(string)
GET /networks/{id}/network_interfaces
go
	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)
返回参数:
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
record_type
(字符串)、
region
(对象)、
region_code
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
type
(字符串)、
updated_at
(字符串)

Get all Private Wireless Gateways

列出所有私有无线网关

Get all Private Wireless Gateways belonging to the user.
GET /private_wireless_gateways
go
	page, err := client.PrivateWirelessGateways.List(context.Background(), telnyx.PrivateWirelessGatewayListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
Returns:
assigned_resources
(array[object]),
created_at
(string),
id
(uuid),
ip_range
(string),
name
(string),
network_id
(uuid),
record_type
(string),
region_code
(string),
status
(object),
updated_at
(string)
获取用户名下所有私有无线网关。
GET /private_wireless_gateways
go
	page, err := client.PrivateWirelessGateways.List(context.Background(), telnyx.PrivateWirelessGatewayListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
返回参数:
assigned_resources
(对象数组)、
created_at
(字符串)、
id
(uuid)、
ip_range
(字符串)、
name
(字符串)、
network_id
(uuid)、
record_type
(字符串)、
region_code
(字符串)、
status
(对象)、
updated_at
(字符串)

Create 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_gateways
— Required:
network_id
,
name
Optional:
region_code
(string)
go
	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:
assigned_resources
(array[object]),
created_at
(string),
id
(uuid),
ip_range
(string),
name
(string),
network_id
(uuid),
record_type
(string),
region_code
(string),
status
(object),
updated_at
(string)
为已有网络的SIM卡异步创建私有无线网关。该操作可能需要几分钟,你可以通过「查询私有无线网关」接口查看创建状态。
POST /private_wireless_gateways
— 必填参数:
network_id
name
可选参数:
region_code
(字符串)
go
	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)
返回参数:
assigned_resources
(对象数组)、
created_at
(字符串)、
id
(uuid)、
ip_range
(字符串)、
name
(字符串)、
network_id
(uuid)、
record_type
(字符串)、
region_code
(字符串)、
status
(对象)、
updated_at
(字符串)

Get 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:
assigned_resources
(array[object]),
created_at
(string),
id
(uuid),
ip_range
(string),
name
(string),
network_id
(uuid),
record_type
(string),
region_code
(string),
status
(object),
updated_at
(string)
查询私有无线网关的相关信息。
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)
返回参数:
assigned_resources
(对象数组)、
created_at
(字符串)、
id
(uuid)、
ip_range
(字符串)、
name
(字符串)、
network_id
(uuid)、
record_type
(字符串)、
region_code
(字符串)、
status
(对象)、
updated_at
(字符串)

Delete 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:
assigned_resources
(array[object]),
created_at
(string),
id
(uuid),
ip_range
(string),
name
(string),
network_id
(uuid),
record_type
(string),
region_code
(string),
status
(object),
updated_at
(string)
删除私有无线网关。
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)
返回参数:
assigned_resources
(对象数组)、
created_at
(字符串)、
id
(uuid)、
ip_range
(字符串)、
name
(字符串)、
network_id
(uuid)、
record_type
(字符串)、
region_code
(字符串)、
status
(对象)、
updated_at
(字符串)

List all Public Internet Gateways

列出所有公共互联网网关

List all Public Internet Gateways.
GET /public_internet_gateways
go
	page, err := client.PublicInternetGateways.List(context.Background(), telnyx.PublicInternetGatewayListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
Returns:
created_at
(string),
id
(uuid),
name
(string),
network_id
(uuid),
public_ip
(string),
record_type
(string),
region_code
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
列出所有公共互联网网关。
GET /public_internet_gateways
go
	page, err := client.PublicInternetGateways.List(context.Background(), telnyx.PublicInternetGatewayListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
返回参数:
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
public_ip
(字符串)、
record_type
(字符串)、
region_code
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

Create a Public Internet Gateway

创建公共互联网网关

Create a new Public Internet Gateway.
POST /public_internet_gateways
Optional:
created_at
(string),
id
(uuid),
name
(string),
network_id
(uuid),
public_ip
(string),
record_type
(string),
region_code
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
go
	publicInternetGateway, err := client.PublicInternetGateways.New(context.Background(), telnyx.PublicInternetGatewayNewParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", publicInternetGateway.Data)
Returns:
created_at
(string),
id
(uuid),
name
(string),
network_id
(uuid),
public_ip
(string),
record_type
(string),
region_code
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
创建一个新的公共互联网网关。
POST /public_internet_gateways
可选参数:
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
public_ip
(字符串)、
record_type
(字符串)、
region_code
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)
go
	publicInternetGateway, err := client.PublicInternetGateways.New(context.Background(), telnyx.PublicInternetGatewayNewParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", publicInternetGateway.Data)
返回参数:
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
public_ip
(字符串)、
record_type
(字符串)、
region_code
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

Retrieve 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:
created_at
(string),
id
(uuid),
name
(string),
network_id
(uuid),
public_ip
(string),
record_type
(string),
region_code
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
查询单个公共互联网网关。
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)
返回参数:
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
public_ip
(字符串)、
record_type
(字符串)、
region_code
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

Delete 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:
created_at
(string),
id
(uuid),
name
(string),
network_id
(uuid),
public_ip
(string),
record_type
(string),
region_code
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
删除公共互联网网关。
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)
返回参数:
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
public_ip
(字符串)、
record_type
(字符串)、
region_code
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

List all Regions

列出所有区域

List all regions and the interfaces that region supports
GET /regions
go
	regions, err := client.Regions.List(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", regions.Data)
Returns:
code
(string),
created_at
(string),
name
(string),
record_type
(string),
supported_interfaces
(array[string]),
updated_at
(string)
列出所有区域及该区域支持的接口类型
GET /regions
go
	regions, err := client.Regions.List(context.Background())
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", regions.Data)
返回参数:
code
(字符串)、
created_at
(字符串)、
name
(字符串)、
record_type
(字符串)、
supported_interfaces
(字符串数组)、
updated_at
(字符串)

List all Virtual Cross Connects

列出所有虚拟交叉连接

List all Virtual Cross Connects.
GET /virtual_cross_connects
go
	page, err := client.VirtualCrossConnects.List(context.Background(), telnyx.VirtualCrossConnectListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
Returns:
bandwidth_mbps
(number),
bgp_asn
(number),
cloud_provider
(enum: aws, azure, gce),
cloud_provider_region
(string),
created_at
(string),
id
(uuid),
name
(string),
network_id
(uuid),
primary_bgp_key
(string),
primary_cloud_account_id
(string),
primary_cloud_ip
(string),
primary_enabled
(boolean),
primary_routing_announcement
(boolean),
primary_telnyx_ip
(string),
record_type
(string),
region
(object),
region_code
(string),
secondary_bgp_key
(string),
secondary_cloud_account_id
(string),
secondary_cloud_ip
(string),
secondary_enabled
(boolean),
secondary_routing_announcement
(boolean),
secondary_telnyx_ip
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
列出所有虚拟交叉连接。
GET /virtual_cross_connects
go
	page, err := client.VirtualCrossConnects.List(context.Background(), telnyx.VirtualCrossConnectListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
返回参数:
bandwidth_mbps
(数字)、
bgp_asn
(数字)、
cloud_provider
(枚举值:aws、azure、gce)、
cloud_provider_region
(字符串)、
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
primary_bgp_key
(字符串)、
primary_cloud_account_id
(字符串)、
primary_cloud_ip
(字符串)、
primary_enabled
(布尔值)、
primary_routing_announcement
(布尔值)、
primary_telnyx_ip
(字符串)、
record_type
(字符串)、
region
(对象)、
region_code
(字符串)、
secondary_bgp_key
(字符串)、
secondary_cloud_account_id
(字符串)、
secondary_cloud_ip
(字符串)、
secondary_enabled
(布尔值)、
secondary_routing_announcement
(布尔值)、
secondary_telnyx_ip
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

Create 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_connects
— Required:
network_id
,
region_code
,
cloud_provider
,
cloud_provider_region
,
bgp_asn
,
primary_cloud_account_id
Optional:
bandwidth_mbps
(number),
created_at
(string),
id
(uuid),
name
(string),
primary_bgp_key
(string),
primary_cloud_ip
(string),
primary_enabled
(boolean),
primary_telnyx_ip
(string),
record_type
(string),
secondary_bgp_key
(string),
secondary_cloud_account_id
(string),
secondary_cloud_ip
(string),
secondary_enabled
(boolean),
secondary_telnyx_ip
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
go
	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:
bandwidth_mbps
(number),
bgp_asn
(number),
cloud_provider
(enum: aws, azure, gce),
cloud_provider_region
(string),
created_at
(string),
id
(uuid),
name
(string),
network_id
(uuid),
primary_bgp_key
(string),
primary_cloud_account_id
(string),
primary_cloud_ip
(string),
primary_enabled
(boolean),
primary_routing_announcement
(boolean),
primary_telnyx_ip
(string),
record_type
(string),
region
(object),
region_code
(string),
secondary_bgp_key
(string),
secondary_cloud_account_id
(string),
secondary_cloud_ip
(string),
secondary_enabled
(boolean),
secondary_routing_announcement
(boolean),
secondary_telnyx_ip
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
创建一个新的虚拟交叉连接。对于AWS和GCE,你可以选择先创建主连接,之后再创建备连接,也可以随时禁用主/备连接之后再重新启用。Azure不支持该操作模式。
POST /virtual_cross_connects
— 必填参数:
network_id
region_code
cloud_provider
cloud_provider_region
bgp_asn
primary_cloud_account_id
可选参数:
bandwidth_mbps
(数字)、
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
primary_bgp_key
(字符串)、
primary_cloud_ip
(字符串)、
primary_enabled
(布尔值)、
primary_telnyx_ip
(字符串)、
record_type
(字符串)、
secondary_bgp_key
(字符串)、
secondary_cloud_account_id
(字符串)、
secondary_cloud_ip
(字符串)、
secondary_enabled
(布尔值)、
secondary_telnyx_ip
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)
go
	virtualCrossConnect, err := client.VirtualCrossConnects.New(context.Background(), telnyx.VirtualCrossConnectNewParams{
		RegionCode: "ashburn-va",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", virtualCrossConnect.Data)
返回参数:
bandwidth_mbps
(数字)、
bgp_asn
(数字)、
cloud_provider
(枚举值:aws、azure、gce)、
cloud_provider_region
(字符串)、
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
primary_bgp_key
(字符串)、
primary_cloud_account_id
(字符串)、
primary_cloud_ip
(字符串)、
primary_enabled
(布尔值)、
primary_routing_announcement
(布尔值)、
primary_telnyx_ip
(字符串)、
record_type
(字符串)、
region
(对象)、
region_code
(字符串)、
secondary_bgp_key
(字符串)、
secondary_cloud_account_id
(字符串)、
secondary_cloud_ip
(字符串)、
secondary_enabled
(布尔值)、
secondary_routing_announcement
(布尔值)、
secondary_telnyx_ip
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

Retrieve 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:
bandwidth_mbps
(number),
bgp_asn
(number),
cloud_provider
(enum: aws, azure, gce),
cloud_provider_region
(string),
created_at
(string),
id
(uuid),
name
(string),
network_id
(uuid),
primary_bgp_key
(string),
primary_cloud_account_id
(string),
primary_cloud_ip
(string),
primary_enabled
(boolean),
primary_routing_announcement
(boolean),
primary_telnyx_ip
(string),
record_type
(string),
region
(object),
region_code
(string),
secondary_bgp_key
(string),
secondary_cloud_account_id
(string),
secondary_cloud_ip
(string),
secondary_enabled
(boolean),
secondary_routing_announcement
(boolean),
secondary_telnyx_ip
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
查询单个虚拟交叉连接。
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)
返回参数:
bandwidth_mbps
(数字)、
bgp_asn
(数字)、
cloud_provider
(枚举值:aws、azure、gce)、
cloud_provider_region
(字符串)、
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
primary_bgp_key
(字符串)、
primary_cloud_account_id
(字符串)、
primary_cloud_ip
(字符串)、
primary_enabled
(布尔值)、
primary_routing_announcement
(布尔值)、
primary_telnyx_ip
(字符串)、
record_type
(字符串)、
region
(对象)、
region_code
(字符串)、
secondary_bgp_key
(字符串)、
secondary_cloud_account_id
(字符串)、
secondary_cloud_ip
(字符串)、
secondary_enabled
(布尔值)、
secondary_routing_announcement
(布尔值)、
secondary_telnyx_ip
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

Update the Virtual Cross Connect

更新虚拟交叉连接

Update the Virtual Cross Connect. Cloud IPs can only be patched during the
created
state, as GCE will only inform you of your generated IP once the pending connection requested has been accepted.
PATCH /virtual_cross_connects/{id}
Optional:
primary_cloud_ip
(string),
primary_enabled
(boolean),
primary_routing_announcement
(boolean),
secondary_cloud_ip
(string),
secondary_enabled
(boolean),
secondary_routing_announcement
(boolean)
go
	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:
bandwidth_mbps
(number),
bgp_asn
(number),
cloud_provider
(enum: aws, azure, gce),
cloud_provider_region
(string),
created_at
(string),
id
(uuid),
name
(string),
network_id
(uuid),
primary_bgp_key
(string),
primary_cloud_account_id
(string),
primary_cloud_ip
(string),
primary_enabled
(boolean),
primary_routing_announcement
(boolean),
primary_telnyx_ip
(string),
record_type
(string),
region
(object),
region_code
(string),
secondary_bgp_key
(string),
secondary_cloud_account_id
(string),
secondary_cloud_ip
(string),
secondary_enabled
(boolean),
secondary_routing_announcement
(boolean),
secondary_telnyx_ip
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
更新虚拟交叉连接。云IP仅能在
created
状态下修改,因为GCE仅会在待处理的连接请求被接受后才会通知你生成的IP地址。
PATCH /virtual_cross_connects/{id}
可选参数:
primary_cloud_ip
(字符串)、
primary_enabled
(布尔值)、
primary_routing_announcement
(布尔值)、
secondary_cloud_ip
(字符串)、
secondary_enabled
(布尔值)、
secondary_routing_announcement
(布尔值)
go
	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)
返回参数:
bandwidth_mbps
(数字)、
bgp_asn
(数字)、
cloud_provider
(枚举值:aws、azure、gce)、
cloud_provider_region
(字符串)、
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
primary_bgp_key
(字符串)、
primary_cloud_account_id
(字符串)、
primary_cloud_ip
(字符串)、
primary_enabled
(布尔值)、
primary_routing_announcement
(布尔值)、
primary_telnyx_ip
(字符串)、
record_type
(字符串)、
region
(对象)、
region_code
(字符串)、
secondary_bgp_key
(字符串)、
secondary_cloud_account_id
(字符串)、
secondary_cloud_ip
(字符串)、
secondary_enabled
(布尔值)、
secondary_routing_announcement
(布尔值)、
secondary_telnyx_ip
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

Delete 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:
bandwidth_mbps
(number),
bgp_asn
(number),
cloud_provider
(enum: aws, azure, gce),
cloud_provider_region
(string),
created_at
(string),
id
(uuid),
name
(string),
network_id
(uuid),
primary_bgp_key
(string),
primary_cloud_account_id
(string),
primary_cloud_ip
(string),
primary_enabled
(boolean),
primary_routing_announcement
(boolean),
primary_telnyx_ip
(string),
record_type
(string),
region
(object),
region_code
(string),
secondary_bgp_key
(string),
secondary_cloud_account_id
(string),
secondary_cloud_ip
(string),
secondary_enabled
(boolean),
secondary_routing_announcement
(boolean),
secondary_telnyx_ip
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
删除虚拟交叉连接。
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)
返回参数:
bandwidth_mbps
(数字)、
bgp_asn
(数字)、
cloud_provider
(枚举值:aws、azure、gce)、
cloud_provider_region
(字符串)、
created_at
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
primary_bgp_key
(字符串)、
primary_cloud_account_id
(字符串)、
primary_cloud_ip
(字符串)、
primary_enabled
(布尔值)、
primary_routing_announcement
(布尔值)、
primary_telnyx_ip
(字符串)、
record_type
(字符串)、
region
(对象)、
region_code
(字符串)、
secondary_bgp_key
(字符串)、
secondary_cloud_account_id
(字符串)、
secondary_cloud_ip
(字符串)、
secondary_enabled
(布尔值)、
secondary_routing_announcement
(布尔值)、
secondary_telnyx_ip
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

List Virtual Cross Connect Cloud Coverage

列出虚拟交叉连接云覆盖区域

List Virtual Cross Connects Cloud Coverage. This endpoint shows which cloud regions are available for the
location_code
your Virtual Cross Connect will be provisioned in.
GET /virtual_cross_connects_coverage
go
	page, err := client.VirtualCrossConnectsCoverage.List(context.Background(), telnyx.VirtualCrossConnectsCoverageListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
Returns:
available_bandwidth
(array[number]),
cloud_provider
(enum: aws, azure, gce),
cloud_provider_region
(string),
location
(object),
record_type
(string)
列出虚拟交叉连接的云覆盖区域。该接口会返回你要部署虚拟交叉连接的
location_code
对应的可用云区域。
GET /virtual_cross_connects_coverage
go
	page, err := client.VirtualCrossConnectsCoverage.List(context.Background(), telnyx.VirtualCrossConnectsCoverageListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
返回参数:
available_bandwidth
(数字数组)、
cloud_provider
(枚举值:aws、azure、gce)、
cloud_provider_region
(字符串)、
location
(对象)、
record_type
(字符串)

List all WireGuard Interfaces

列出所有WireGuard接口

List all WireGuard Interfaces.
GET /wireguard_interfaces
go
	page, err := client.WireguardInterfaces.List(context.Background(), telnyx.WireguardInterfaceListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
Returns:
created_at
(string),
enable_sip_trunking
(boolean),
endpoint
(string),
id
(uuid),
name
(string),
network_id
(uuid),
public_key
(string),
record_type
(string),
region
(object),
region_code
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
列出所有WireGuard接口。
GET /wireguard_interfaces
go
	page, err := client.WireguardInterfaces.List(context.Background(), telnyx.WireguardInterfaceListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
返回参数:
created_at
(字符串)、
enable_sip_trunking
(布尔值)、
endpoint
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
public_key
(字符串)、
record_type
(字符串)、
region
(对象)、
region_code
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

Create a WireGuard Interface

创建WireGuard接口

Create a new WireGuard Interface. Current limitation of 10 interfaces per user can be created.
POST /wireguard_interfaces
— Required:
network_id
,
region_code
Optional:
created_at
(string),
enable_sip_trunking
(boolean),
endpoint
(string),
id
(uuid),
name
(string),
public_key
(string),
record_type
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
go
	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:
created_at
(string),
enable_sip_trunking
(boolean),
endpoint
(string),
id
(uuid),
name
(string),
network_id
(uuid),
public_key
(string),
record_type
(string),
region
(object),
region_code
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
创建一个新的WireGuard接口。当前限制每个用户最多可创建10个接口。
POST /wireguard_interfaces
— 必填参数:
network_id
region_code
可选参数:
created_at
(字符串)、
enable_sip_trunking
(布尔值)、
endpoint
(字符串)、
id
(uuid)、
name
(字符串)、
public_key
(字符串)、
record_type
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)
go
	wireguardInterface, err := client.WireguardInterfaces.New(context.Background(), telnyx.WireguardInterfaceNewParams{
		RegionCode: "ashburn-va",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", wireguardInterface.Data)
返回参数:
created_at
(字符串)、
enable_sip_trunking
(布尔值)、
endpoint
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
public_key
(字符串)、
record_type
(字符串)、
region
(对象)、
region_code
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

Retrieve 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:
created_at
(string),
enable_sip_trunking
(boolean),
endpoint
(string),
id
(uuid),
name
(string),
network_id
(uuid),
public_key
(string),
record_type
(string),
region
(object),
region_code
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
查询单个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)
返回参数:
created_at
(字符串)、
enable_sip_trunking
(布尔值)、
endpoint
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
public_key
(字符串)、
record_type
(字符串)、
region
(对象)、
region_code
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

Delete 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:
created_at
(string),
enable_sip_trunking
(boolean),
endpoint
(string),
id
(uuid),
name
(string),
network_id
(uuid),
public_key
(string),
record_type
(string),
region
(object),
region_code
(string),
status
(enum: created, provisioning, provisioned, deleting),
updated_at
(string)
删除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)
返回参数:
created_at
(字符串)、
enable_sip_trunking
(布尔值)、
endpoint
(字符串)、
id
(uuid)、
name
(字符串)、
network_id
(uuid)、
public_key
(字符串)、
record_type
(字符串)、
region
(对象)、
region_code
(字符串)、
status
(枚举值:created、provisioning、provisioned、deleting)、
updated_at
(字符串)

List all WireGuard Peers

列出所有WireGuard对等节点

List all WireGuard peers.
GET /wireguard_peers
go
	page, err := client.WireguardPeers.List(context.Background(), telnyx.WireguardPeerListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
Returns:
created_at
(string),
id
(uuid),
last_seen
(string),
private_key
(string),
public_key
(string),
record_type
(string),
updated_at
(string),
wireguard_interface_id
(uuid)
列出所有WireGuard对等节点。
GET /wireguard_peers
go
	page, err := client.WireguardPeers.List(context.Background(), telnyx.WireguardPeerListParams{})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", page)
返回参数:
created_at
(字符串)、
id
(uuid)、
last_seen
(字符串)、
private_key
(字符串)、
public_key
(字符串)、
record_type
(字符串)、
updated_at
(字符串)、
wireguard_interface_id
(uuid)

Create a WireGuard Peer

创建WireGuard对等节点

Create a new WireGuard Peer. Current limitation of 5 peers per interface can be created.
POST /wireguard_peers
— Required:
wireguard_interface_id
Optional:
created_at
(string),
id
(uuid),
last_seen
(string),
private_key
(string),
public_key
(string),
record_type
(string),
updated_at
(string)
go
	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:
created_at
(string),
id
(uuid),
last_seen
(string),
private_key
(string),
public_key
(string),
record_type
(string),
updated_at
(string),
wireguard_interface_id
(uuid)
创建一个新的WireGuard对等节点。当前限制每个接口最多可创建5个对等节点。
POST /wireguard_peers
— 必填参数:
wireguard_interface_id
可选参数:
created_at
(字符串)、
id
(uuid)、
last_seen
(字符串)、
private_key
(字符串)、
public_key
(字符串)、
record_type
(字符串)、
updated_at
(字符串)
go
	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)
返回参数:
created_at
(字符串)、
id
(uuid)、
last_seen
(字符串)、
private_key
(字符串)、
public_key
(字符串)、
record_type
(字符串)、
updated_at
(字符串)、
wireguard_interface_id
(uuid)

Retrieve 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:
created_at
(string),
id
(uuid),
last_seen
(string),
private_key
(string),
public_key
(string),
record_type
(string),
updated_at
(string),
wireguard_interface_id
(uuid)
查询单个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)
返回参数:
created_at
(字符串)、
id
(uuid)、
last_seen
(字符串)、
private_key
(字符串)、
public_key
(字符串)、
record_type
(字符串)、
updated_at
(字符串)、
wireguard_interface_id
(uuid)

Update the WireGuard Peer

更新WireGuard对等节点

Update the WireGuard peer.
PATCH /wireguard_peers/{id}
Optional:
public_key
(string)
go
	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:
created_at
(string),
id
(uuid),
last_seen
(string),
private_key
(string),
public_key
(string),
record_type
(string),
updated_at
(string),
wireguard_interface_id
(uuid)
更新WireGuard对等节点。
PATCH /wireguard_peers/{id}
可选参数:
public_key
(字符串)
go
	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)
返回参数:
created_at
(字符串)、
id
(uuid)、
last_seen
(字符串)、
private_key
(字符串)、
public_key
(字符串)、
record_type
(字符串)、
updated_at
(字符串)、
wireguard_interface_id
(uuid)

Delete 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:
created_at
(string),
id
(uuid),
last_seen
(string),
private_key
(string),
public_key
(string),
record_type
(string),
updated_at
(string),
wireguard_interface_id
(uuid)
删除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)
返回参数:
created_at
(字符串)、
id
(uuid)、
last_seen
(字符串)、
private_key
(字符串)、
public_key
(字符串)、
record_type
(字符串)、
updated_at
(字符串)、
wireguard_interface_id
(uuid)

Retrieve Wireguard config template for Peer

获取对等节点的WireGuard配置模板

GET /wireguard_peers/{id}/config
go
	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}/config
go
	response, err := client.WireguardPeers.GetConfig(context.Background(), "6a09cdc3-8948-47f0-aa62-74ac943d6c58")
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", response)