跳至内容

equinix_fabric_cloud_routers(数据源)

兼容 Fabric V4 API 的数据资源,允许用户获取符合自定义搜索条件的 Fabric 云路由器。

补充文件:

用法示例

data "equinix_fabric_cloud_routers" "test" {
filter {
property = "/name"
operator = "="
values = ["Test_PFCR"]
}
filter {
property = "/location/metroCode"
operator = "="
values = ["SV"]
}
filter {
property = "/package/code"
operator = "="
values = ["STANDARD"]
or = true
}
filter {
property = "/state"
operator = "="
values = ["ACTIVE"]
or = true
}
pagination {
offset = 5
limit = 3
}
sort {
direction = "ASC"
property = "/name"
}
}

output "number_of_returned_fcrs" {
value = length(data.equinix_fabric_cloud_routers.test.data)
}

output "first_fcr_name" {
value = data.equinix_fabric_cloud_routers.test.data.0.name
}

output "first_fcr_state" {
value = data.equinix_fabric_cloud_routers.test.data.0.state
}

output "first_fcr_uuid" {
value = data.equinix_fabric_cloud_routers.test.data.0.uuid
}

output "first_fcr_type" {
value = data.equinix_fabric_cloud_routers.test.data.0.type
}

output "first_fcr_package_code" {
value = one(data.equinix_fabric_cloud_routers.test.data.0.package).code
}

output "first_fcr_equinix_asn" {
value = data.equinix_fabric_cloud_routers.test.data.0.equinix_asn
}

output "first_fcr_location_region" {
value = one(data.equinix_fabric_cloud_routers.test.data.0.location).region
}

output "first_fcr_location_metro_name" {
value = one(data.equinix_fabric_cloud_routers.test.data.0.location).metro_name
}

output "first_fcr_location_metro_code" {
value = one(data.equinix_fabric_cloud_routers.test.data.0.location).metro_code
}

output "first_fcr_project_id" {
value = one(data.equinix_fabric_cloud_routers.test.data.0.project).project_id
}

output "first_fcr_account_number" {
value = one(data.equinix_fabric_cloud_routers.test.data.0.account).account_number
}

模式

需要

  • filter(阻止列表,最小值:1,最大值:10)数据源搜索请求的筛选器。最多可设置 8 个筛选器。(嵌套架构请参见下方

可选

  • pagination(块集,最大值:1)数据源搜索请求的分页详细信息(有关嵌套架构,请参见下文
  • sort(阻止列表)数据源搜索请求的过滤器(有关嵌套架构,请参见下文

只读

  • data(对象列表)云路由器列表(嵌套模式见下文)
  • id(字符串)此资源的 ID。

filter 的嵌套模式

必需的:

  • operator(字符串)可用于筛选属性的运算符。可以是以下运算符之一:[= - 等于,!= - 不等于, > - 大于, >= - 大于或等于,< 小于,<= - 小于或等于,[非] 之间 - (非)之间,[非] 像 - (非)像,[非] 在 - (非)在
  • property(字符串)用于筛选请求的 API 响应属性。可以是以下值之一:"/project/projectId", "/name", "/uuid", "/state", "/location/metroCode", "/location/metroName", "/package/code", "/*"
  • values(字符串列表)要应用属性+运算符组合以筛选数据搜索的值

选修的:

  • or(布尔值)布尔标志,指示此筛选器是否包含在 OR 组中。只能有一个 OR 组,且最多可包含 3 个筛选器。OR 组仅计入 8 个筛选器中的 1 个。

pagination 的嵌套模式

选修的:

  • limit(数字)每页请求的元素数量。数字必须介于 1 和 100 之间。默认值为 20。
  • offset(数字)分页请求的页面偏移量。第一个元素的索引。默认值为 0。

sort 的嵌套模式

选修的:

  • direction(字符串)排序方向。可以是以下值之一:[DESC, ASC],默认为 DESC。
  • property(字符串)用于排序的属性名称。可以是以下值之一:[/name, /uuid, /state, /location/metroCode, /location/metroName, /package/code, /changeLog/createdDateTime, /changeLog/updatedDateTime],默认为 /changeLog/updatedDateTime

data 的嵌套模式

只读:

  • account(对象集合)(有关嵌套模式,请参见下文
  • change_log(对象集合)(有关嵌套模式,请参见下文
  • connections_count(数字)
  • description(字符串)
  • equinix_asn(数字)
  • href(字符串)
  • location(对象集合)(有关嵌套模式,请参见下文
  • marketplace_subscription(对象集合)(有关嵌套模式,请参见下文
  • name(字符串)
  • notifications(对象列表)(有关嵌套模式,请参见下方
  • order(对象集合)(有关嵌套模式,请参见下文
  • package(对象集合)(有关嵌套模式,请参见下文
  • project(对象集合)(有关嵌套模式,请参见下文
  • state(字符串)
  • type(字符串)
  • uuid(字符串)

data.account 的嵌套模式

只读:

  • account_number(数字)

data.change_log 的嵌套模式

只读:

  • created_by(字符串)
  • created_by_email(字符串)
  • created_by_full_name(字符串)
  • created_date_time(字符串)
  • deleted_by(字符串)
  • deleted_by_email(字符串)
  • deleted_by_full_name(字符串)
  • deleted_date_time(字符串)
  • updated_by(字符串)
  • updated_by_email(字符串)
  • updated_by_full_name(字符串)
  • updated_date_time(字符串)

data.location 的嵌套模式

只读:

  • ibx(字符串)
  • metro_code(字符串)
  • metro_name(字符串)
  • region(字符串)

data.marketplace_subscription 的嵌套模式

只读:

  • type(字符串)
  • uuid(字符串)

data.notifications 的嵌套模式

只读:

  • emails(字符串列表)
  • send_interval(字符串)
  • type(字符串)

data.order 的嵌套模式

只读:

  • billing_tier(字符串)
  • order_id(字符串)
  • order_number(字符串)
  • purchase_order_number(字符串)
  • term_length(数字)

data.package 的嵌套模式

只读:

  • code(字符串)

data.project 的嵌套模式

只读:

  • href(字符串)
  • project_id(字符串)
此页面有帮助吗?