Skip to content
Start here

Read Resource

client.magicCloudNetworking.resources.get(stringresourceId, ResourceGetParams { account_id, v2 } params, RequestOptionsoptions?): ResourceGetResponse { id, account_id, cloud_type, 18 more }
GET/accounts/{account_id}/magic/cloud/resources/{resource_id}

Read an resource from the Resource Catalog (Closed Beta).

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Magic WAN WriteMagic WAN Read
ParametersExpand Collapse
resourceId: string
formatuuid
params: ResourceGetParams { account_id, v2 }
account_id: string

Path param

v2?: boolean

Query param

ReturnsExpand Collapse
ResourceGetResponse { id, account_id, cloud_type, 18 more }
id: string
formatuuid
account_id: string
cloud_type: "AWS" | "AZURE" | "GOOGLE" | "CLOUDFLARE"
One of the following:
"AWS"
"AZURE"
"GOOGLE"
"CLOUDFLARE"
config: Record<string, unknown>
deployment_provider: string
formatuuid
managed: boolean
monthly_cost_estimate: MonthlyCostEstimate { currency, monthly_cost }
currency: string
monthly_cost: number
formatdouble
name: string
native_id: string
observations: Record<string, Observations>
first_observed_at: string
last_observed_at: string
provider_id: string
formatuuid
resource_id: string
formatuuid
provider_ids: Array<string>
provider_names_by_id: Record<string, string>
region: string
resource_group: string
resource_type: "aws_customer_gateway" | "aws_egress_only_internet_gateway" | "aws_internet_gateway" | 54 more
One of the following:
"aws_customer_gateway"
"aws_egress_only_internet_gateway"
"aws_internet_gateway"
"aws_instance"
"aws_network_interface"
"aws_route"
"aws_route_table"
"aws_route_table_association"
"aws_subnet"
"aws_vpc"
"aws_vpc_ipv4_cidr_block_association"
"aws_vpn_connection"
"aws_vpn_connection_route"
"aws_vpn_gateway"
"aws_security_group"
"aws_vpc_security_group_ingress_rule"
"aws_vpc_security_group_egress_rule"
"aws_ec2_managed_prefix_list"
"aws_ec2_transit_gateway"
"aws_ec2_transit_gateway_prefix_list_reference"
"aws_ec2_transit_gateway_vpc_attachment"
"azurerm_application_security_group"
"azurerm_lb"
"azurerm_lb_backend_address_pool"
"azurerm_lb_nat_pool"
"azurerm_lb_nat_rule"
"azurerm_lb_rule"
"azurerm_local_network_gateway"
"azurerm_network_interface"
"azurerm_network_interface_application_security_group_association"
"azurerm_network_interface_backend_address_pool_association"
"azurerm_network_interface_security_group_association"
"azurerm_network_security_group"
"azurerm_public_ip"
"azurerm_route"
"azurerm_route_table"
"azurerm_subnet"
"azurerm_subnet_route_table_association"
"azurerm_virtual_machine"
"azurerm_virtual_network_gateway_connection"
"azurerm_virtual_network"
"azurerm_virtual_network_gateway"
"google_compute_network"
"google_compute_subnetwork"
"google_compute_vpn_gateway"
"google_compute_vpn_tunnel"
"google_compute_route"
"google_compute_address"
"google_compute_global_address"
"google_compute_router"
"google_compute_interconnect_attachment"
"google_compute_ha_vpn_gateway"
"google_compute_forwarding_rule"
"google_compute_network_firewall_policy"
"google_compute_network_firewall_policy_rule"
"cloudflare_static_route"
"cloudflare_ipsec_tunnel"
sections: Array<Section>
hidden_items: Array<HiddenItem>
helpText?: string
name?: string
value?: McnStringItem { item_type, string } | McnYamlItem { item_type, yaml } | McnYamlDiffItem { item_type, yaml_diff } | 2 more
One of the following:
McnStringItem { item_type, string }
item_type: string
string: string
McnYamlItem { item_type, yaml }
item_type: string
yaml: string
McnYamlDiffItem { item_type, yaml_diff }
item_type: string
yaml_diff: YamlDiff { diff, left_description, left_yaml, 2 more }
diff: string
left_description: string
left_yaml: string
right_description: string
right_yaml: string
McnResourcePreviewItem { item_type, resource_preview }
item_type: string
resource_preview: ResourcePreview { id, cloud_type, detail, 3 more }
id: string
formatuuid
cloud_type: "AWS" | "AZURE" | "GOOGLE" | "CLOUDFLARE"
One of the following:
"AWS"
"AZURE"
"GOOGLE"
"CLOUDFLARE"
detail: string
name: string
resource_type: "aws_customer_gateway" | "aws_egress_only_internet_gateway" | "aws_internet_gateway" | 54 more
One of the following:
"aws_customer_gateway"
"aws_egress_only_internet_gateway"
"aws_internet_gateway"
"aws_instance"
"aws_network_interface"
"aws_route"
"aws_route_table"
"aws_route_table_association"
"aws_subnet"
"aws_vpc"
"aws_vpc_ipv4_cidr_block_association"
"aws_vpn_connection"
"aws_vpn_connection_route"
"aws_vpn_gateway"
"aws_security_group"
"aws_vpc_security_group_ingress_rule"
"aws_vpc_security_group_egress_rule"
"aws_ec2_managed_prefix_list"
"aws_ec2_transit_gateway"
"aws_ec2_transit_gateway_prefix_list_reference"
"aws_ec2_transit_gateway_vpc_attachment"
"azurerm_application_security_group"
"azurerm_lb"
"azurerm_lb_backend_address_pool"
"azurerm_lb_nat_pool"
"azurerm_lb_nat_rule"
"azurerm_lb_rule"
"azurerm_local_network_gateway"
"azurerm_network_interface"
"azurerm_network_interface_application_security_group_association"
"azurerm_network_interface_backend_address_pool_association"
"azurerm_network_interface_security_group_association"
"azurerm_network_security_group"
"azurerm_public_ip"
"azurerm_route"
"azurerm_route_table"
"azurerm_subnet"
"azurerm_subnet_route_table_association"
"azurerm_virtual_machine"
"azurerm_virtual_network_gateway_connection"
"azurerm_virtual_network"
"azurerm_virtual_network_gateway"
"google_compute_network"
"google_compute_subnetwork"
"google_compute_vpn_gateway"
"google_compute_vpn_tunnel"
"google_compute_route"
"google_compute_address"
"google_compute_global_address"
"google_compute_router"
"google_compute_interconnect_attachment"
"google_compute_ha_vpn_gateway"
"google_compute_forwarding_rule"
"google_compute_network_firewall_policy"
"google_compute_network_firewall_policy_rule"
"cloudflare_static_route"
"cloudflare_ipsec_tunnel"
title: string
McnListItem { item_type, list }
item_type: string
list: Array<McnStringItem { item_type, string } | McnResourcePreviewItem { item_type, resource_preview } >
One of the following:
McnStringItem { item_type, string }
item_type: string
string: string
McnResourcePreviewItem { item_type, resource_preview }
item_type: string
resource_preview: ResourcePreview { id, cloud_type, detail, 3 more }
id: string
formatuuid
cloud_type: "AWS" | "AZURE" | "GOOGLE" | "CLOUDFLARE"
One of the following:
"AWS"
"AZURE"
"GOOGLE"
"CLOUDFLARE"
detail: string
name: string
resource_type: "aws_customer_gateway" | "aws_egress_only_internet_gateway" | "aws_internet_gateway" | 54 more
One of the following:
"aws_customer_gateway"
"aws_egress_only_internet_gateway"
"aws_internet_gateway"
"aws_instance"
"aws_network_interface"
"aws_route"
"aws_route_table"
"aws_route_table_association"
"aws_subnet"
"aws_vpc"
"aws_vpc_ipv4_cidr_block_association"
"aws_vpn_connection"
"aws_vpn_connection_route"
"aws_vpn_gateway"
"aws_security_group"
"aws_vpc_security_group_ingress_rule"
"aws_vpc_security_group_egress_rule"
"aws_ec2_managed_prefix_list"
"aws_ec2_transit_gateway"
"aws_ec2_transit_gateway_prefix_list_reference"
"aws_ec2_transit_gateway_vpc_attachment"
"azurerm_application_security_group"
"azurerm_lb"
"azurerm_lb_backend_address_pool"
"azurerm_lb_nat_pool"
"azurerm_lb_nat_rule"
"azurerm_lb_rule"
"azurerm_local_network_gateway"
"azurerm_network_interface"
"azurerm_network_interface_application_security_group_association"
"azurerm_network_interface_backend_address_pool_association"
"azurerm_network_interface_security_group_association"
"azurerm_network_security_group"
"azurerm_public_ip"
"azurerm_route"
"azurerm_route_table"
"azurerm_subnet"
"azurerm_subnet_route_table_association"
"azurerm_virtual_machine"
"azurerm_virtual_network_gateway_connection"
"azurerm_virtual_network"
"azurerm_virtual_network_gateway"
"google_compute_network"
"google_compute_subnetwork"
"google_compute_vpn_gateway"
"google_compute_vpn_tunnel"
"google_compute_route"
"google_compute_address"
"google_compute_global_address"
"google_compute_router"
"google_compute_interconnect_attachment"
"google_compute_ha_vpn_gateway"
"google_compute_forwarding_rule"
"google_compute_network_firewall_policy"
"google_compute_network_firewall_policy_rule"
"cloudflare_static_route"
"cloudflare_ipsec_tunnel"
title: string
name: string
visible_items: Array<VisibleItem>
helpText?: string
name?: string
value?: McnStringItem { item_type, string } | McnYamlItem { item_type, yaml } | McnYamlDiffItem { item_type, yaml_diff } | 2 more
One of the following:
McnStringItem { item_type, string }
item_type: string
string: string
McnYamlItem { item_type, yaml }
item_type: string
yaml: string
McnYamlDiffItem { item_type, yaml_diff }
item_type: string
yaml_diff: YamlDiff { diff, left_description, left_yaml, 2 more }
diff: string
left_description: string
left_yaml: string
right_description: string
right_yaml: string
McnResourcePreviewItem { item_type, resource_preview }
item_type: string
resource_preview: ResourcePreview { id, cloud_type, detail, 3 more }
id: string
formatuuid
cloud_type: "AWS" | "AZURE" | "GOOGLE" | "CLOUDFLARE"
One of the following:
"AWS"
"AZURE"
"GOOGLE"
"CLOUDFLARE"
detail: string
name: string
resource_type: "aws_customer_gateway" | "aws_egress_only_internet_gateway" | "aws_internet_gateway" | 54 more
One of the following:
"aws_customer_gateway"
"aws_egress_only_internet_gateway"
"aws_internet_gateway"
"aws_instance"
"aws_network_interface"
"aws_route"
"aws_route_table"
"aws_route_table_association"
"aws_subnet"
"aws_vpc"
"aws_vpc_ipv4_cidr_block_association"
"aws_vpn_connection"
"aws_vpn_connection_route"
"aws_vpn_gateway"
"aws_security_group"
"aws_vpc_security_group_ingress_rule"
"aws_vpc_security_group_egress_rule"
"aws_ec2_managed_prefix_list"
"aws_ec2_transit_gateway"
"aws_ec2_transit_gateway_prefix_list_reference"
"aws_ec2_transit_gateway_vpc_attachment"
"azurerm_application_security_group"
"azurerm_lb"
"azurerm_lb_backend_address_pool"
"azurerm_lb_nat_pool"
"azurerm_lb_nat_rule"
"azurerm_lb_rule"
"azurerm_local_network_gateway"
"azurerm_network_interface"
"azurerm_network_interface_application_security_group_association"
"azurerm_network_interface_backend_address_pool_association"
"azurerm_network_interface_security_group_association"
"azurerm_network_security_group"
"azurerm_public_ip"
"azurerm_route"
"azurerm_route_table"
"azurerm_subnet"
"azurerm_subnet_route_table_association"
"azurerm_virtual_machine"
"azurerm_virtual_network_gateway_connection"
"azurerm_virtual_network"
"azurerm_virtual_network_gateway"
"google_compute_network"
"google_compute_subnetwork"
"google_compute_vpn_gateway"
"google_compute_vpn_tunnel"
"google_compute_route"
"google_compute_address"
"google_compute_global_address"
"google_compute_router"
"google_compute_interconnect_attachment"
"google_compute_ha_vpn_gateway"
"google_compute_forwarding_rule"
"google_compute_network_firewall_policy"
"google_compute_network_firewall_policy_rule"
"cloudflare_static_route"
"cloudflare_ipsec_tunnel"
title: string
McnListItem { item_type, list }
item_type: string
list: Array<McnStringItem { item_type, string } | McnResourcePreviewItem { item_type, resource_preview } >
One of the following:
McnStringItem { item_type, string }
item_type: string
string: string
McnResourcePreviewItem { item_type, resource_preview }
item_type: string
resource_preview: ResourcePreview { id, cloud_type, detail, 3 more }
id: string
formatuuid
cloud_type: "AWS" | "AZURE" | "GOOGLE" | "CLOUDFLARE"
One of the following:
"AWS"
"AZURE"
"GOOGLE"
"CLOUDFLARE"
detail: string
name: string
resource_type: "aws_customer_gateway" | "aws_egress_only_internet_gateway" | "aws_internet_gateway" | 54 more
One of the following:
"aws_customer_gateway"
"aws_egress_only_internet_gateway"
"aws_internet_gateway"
"aws_instance"
"aws_network_interface"
"aws_route"
"aws_route_table"
"aws_route_table_association"
"aws_subnet"
"aws_vpc"
"aws_vpc_ipv4_cidr_block_association"
"aws_vpn_connection"
"aws_vpn_connection_route"
"aws_vpn_gateway"
"aws_security_group"
"aws_vpc_security_group_ingress_rule"
"aws_vpc_security_group_egress_rule"
"aws_ec2_managed_prefix_list"
"aws_ec2_transit_gateway"
"aws_ec2_transit_gateway_prefix_list_reference"
"aws_ec2_transit_gateway_vpc_attachment"
"azurerm_application_security_group"
"azurerm_lb"
"azurerm_lb_backend_address_pool"
"azurerm_lb_nat_pool"
"azurerm_lb_nat_rule"
"azurerm_lb_rule"
"azurerm_local_network_gateway"
"azurerm_network_interface"
"azurerm_network_interface_application_security_group_association"
"azurerm_network_interface_backend_address_pool_association"
"azurerm_network_interface_security_group_association"
"azurerm_network_security_group"
"azurerm_public_ip"
"azurerm_route"
"azurerm_route_table"
"azurerm_subnet"
"azurerm_subnet_route_table_association"
"azurerm_virtual_machine"
"azurerm_virtual_network_gateway_connection"
"azurerm_virtual_network"
"azurerm_virtual_network_gateway"
"google_compute_network"
"google_compute_subnetwork"
"google_compute_vpn_gateway"
"google_compute_vpn_tunnel"
"google_compute_route"
"google_compute_address"
"google_compute_global_address"
"google_compute_router"
"google_compute_interconnect_attachment"
"google_compute_ha_vpn_gateway"
"google_compute_forwarding_rule"
"google_compute_network_firewall_policy"
"google_compute_network_firewall_policy_rule"
"cloudflare_static_route"
"cloudflare_ipsec_tunnel"
title: string
help_text?: string
state: Record<string, unknown>
tags: Record<string, string>
updated_at: string
url: string
managed_by?: Array<ManagedBy>
id: string
formatuuid
client_type: "MAGIC_WAN_CLOUD_ONRAMP"
name: string

Read Resource

import Cloudflare from 'cloudflare';

const client = new Cloudflare({
  apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted
});

const resource = await client.magicCloudNetworking.resources.get(
  '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
  { account_id: 'account_id' },
);

console.log(resource.id);
{
  "errors": [
    {
      "code": 1001,
      "message": "message",
      "documentation_url": "documentation_url",
      "meta": {
        "l10n_key": "l10n_key",
        "loggable_error": "loggable_error",
        "template_data": {},
        "trace_id": "trace_id"
      },
      "source": {
        "parameter": "parameter",
        "parameter_value_index": 0,
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1001,
      "message": "message",
      "documentation_url": "documentation_url",
      "meta": {
        "l10n_key": "l10n_key",
        "loggable_error": "loggable_error",
        "template_data": {},
        "trace_id": "trace_id"
      },
      "source": {
        "parameter": "parameter",
        "parameter_value_index": 0,
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "account_id": "account_id",
    "cloud_type": "AWS",
    "config": {
      "foo": "bar"
    },
    "deployment_provider": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "managed": true,
    "monthly_cost_estimate": {
      "currency": "currency",
      "monthly_cost": 0
    },
    "name": "name",
    "native_id": "native_id",
    "observations": {
      "foo": {
        "first_observed_at": "first_observed_at",
        "last_observed_at": "last_observed_at",
        "provider_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "resource_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
      }
    },
    "provider_ids": [
      "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
    ],
    "provider_names_by_id": {
      "foo": "string"
    },
    "region": "region",
    "resource_group": "resource_group",
    "resource_type": "aws_customer_gateway",
    "sections": [
      {
        "hidden_items": [
          {
            "helpText": "helpText",
            "name": "name",
            "value": {
              "item_type": "item_type",
              "string": "string"
            }
          }
        ],
        "name": "name",
        "visible_items": [
          {
            "helpText": "helpText",
            "name": "name",
            "value": {
              "item_type": "item_type",
              "string": "string"
            }
          }
        ],
        "help_text": "help_text"
      }
    ],
    "state": {
      "foo": "bar"
    },
    "tags": {
      "foo": "string"
    },
    "updated_at": "updated_at",
    "url": "url",
    "managed_by": [
      {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "client_type": "MAGIC_WAN_CLOUD_ONRAMP",
        "name": "name"
      }
    ]
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1001,
      "message": "message",
      "documentation_url": "documentation_url",
      "meta": {
        "l10n_key": "l10n_key",
        "loggable_error": "loggable_error",
        "template_data": {},
        "trace_id": "trace_id"
      },
      "source": {
        "parameter": "parameter",
        "parameter_value_index": 0,
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1001,
      "message": "message",
      "documentation_url": "documentation_url",
      "meta": {
        "l10n_key": "l10n_key",
        "loggable_error": "loggable_error",
        "template_data": {},
        "trace_id": "trace_id"
      },
      "source": {
        "parameter": "parameter",
        "parameter_value_index": 0,
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "account_id": "account_id",
    "cloud_type": "AWS",
    "config": {
      "foo": "bar"
    },
    "deployment_provider": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "managed": true,
    "monthly_cost_estimate": {
      "currency": "currency",
      "monthly_cost": 0
    },
    "name": "name",
    "native_id": "native_id",
    "observations": {
      "foo": {
        "first_observed_at": "first_observed_at",
        "last_observed_at": "last_observed_at",
        "provider_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "resource_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
      }
    },
    "provider_ids": [
      "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
    ],
    "provider_names_by_id": {
      "foo": "string"
    },
    "region": "region",
    "resource_group": "resource_group",
    "resource_type": "aws_customer_gateway",
    "sections": [
      {
        "hidden_items": [
          {
            "helpText": "helpText",
            "name": "name",
            "value": {
              "item_type": "item_type",
              "string": "string"
            }
          }
        ],
        "name": "name",
        "visible_items": [
          {
            "helpText": "helpText",
            "name": "name",
            "value": {
              "item_type": "item_type",
              "string": "string"
            }
          }
        ],
        "help_text": "help_text"
      }
    ],
    "state": {
      "foo": "bar"
    },
    "tags": {
      "foo": "string"
    },
    "updated_at": "updated_at",
    "url": "url",
    "managed_by": [
      {
        "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
        "client_type": "MAGIC_WAN_CLOUD_ONRAMP",
        "name": "name"
      }
    ]
  },
  "success": true
}