Skip to content
Start here

Read Resource

magic_cloud_networking.resources.get(strresource_id, ResourceGetParams**kwargs) -> ResourceGetResponse
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
account_id: str
resource_id: str
formatuuid
v2: Optional[bool]
ReturnsExpand Collapse
class ResourceGetResponse:
id: str
formatuuid
account_id: str
cloud_type: Literal["AWS", "AZURE", "GOOGLE", "CLOUDFLARE"]
One of the following:
"AWS"
"AZURE"
"GOOGLE"
"CLOUDFLARE"
config: Dict[str, object]
deployment_provider: str
formatuuid
managed: bool
monthly_cost_estimate: MonthlyCostEstimate
currency: str
monthly_cost: float
formatdouble
name: str
native_id: str
observations: Dict[str, Observations]
first_observed_at: str
last_observed_at: str
provider_id: str
formatuuid
resource_id: str
formatuuid
provider_ids: List[str]
provider_names_by_id: Dict[str, str]
region: str
resource_group: str
resource_type: Literal["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: List[Section]
hidden_items: List[SectionHiddenItem]
help_text: Optional[str]
name: Optional[str]
value: Optional[SectionHiddenItemValue]
One of the following:
class SectionHiddenItemValueMcnStringItem:
item_type: str
string: str
class SectionHiddenItemValueMcnYamlItem:
item_type: str
yaml: str
class SectionHiddenItemValueMcnYamlDiffItem:
item_type: str
yaml_diff: SectionHiddenItemValueMcnYamlDiffItemYamlDiff
diff: str
left_description: str
left_yaml: str
right_description: str
right_yaml: str
class SectionHiddenItemValueMcnResourcePreviewItem:
item_type: str
resource_preview: SectionHiddenItemValueMcnResourcePreviewItemResourcePreview
id: str
formatuuid
cloud_type: Literal["AWS", "AZURE", "GOOGLE", "CLOUDFLARE"]
One of the following:
"AWS"
"AZURE"
"GOOGLE"
"CLOUDFLARE"
detail: str
name: str
resource_type: Literal["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: str
class SectionHiddenItemValueMcnListItem:
item_type: str
list: List[SectionHiddenItemValueMcnListItemList]
One of the following:
class SectionHiddenItemValueMcnListItemListMcnStringItem:
item_type: str
string: str
class SectionHiddenItemValueMcnListItemListMcnResourcePreviewItem:
item_type: str
resource_preview: SectionHiddenItemValueMcnListItemListMcnResourcePreviewItemResourcePreview
id: str
formatuuid
cloud_type: Literal["AWS", "AZURE", "GOOGLE", "CLOUDFLARE"]
One of the following:
"AWS"
"AZURE"
"GOOGLE"
"CLOUDFLARE"
detail: str
name: str
resource_type: Literal["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: str
name: str
visible_items: List[SectionVisibleItem]
help_text: Optional[str]
name: Optional[str]
value: Optional[SectionVisibleItemValue]
One of the following:
class SectionVisibleItemValueMcnStringItem:
item_type: str
string: str
class SectionVisibleItemValueMcnYamlItem:
item_type: str
yaml: str
class SectionVisibleItemValueMcnYamlDiffItem:
item_type: str
yaml_diff: SectionVisibleItemValueMcnYamlDiffItemYamlDiff
diff: str
left_description: str
left_yaml: str
right_description: str
right_yaml: str
class SectionVisibleItemValueMcnResourcePreviewItem:
item_type: str
resource_preview: SectionVisibleItemValueMcnResourcePreviewItemResourcePreview
id: str
formatuuid
cloud_type: Literal["AWS", "AZURE", "GOOGLE", "CLOUDFLARE"]
One of the following:
"AWS"
"AZURE"
"GOOGLE"
"CLOUDFLARE"
detail: str
name: str
resource_type: Literal["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: str
class SectionVisibleItemValueMcnListItem:
item_type: str
list: List[SectionVisibleItemValueMcnListItemList]
One of the following:
class SectionVisibleItemValueMcnListItemListMcnStringItem:
item_type: str
string: str
class SectionVisibleItemValueMcnListItemListMcnResourcePreviewItem:
item_type: str
resource_preview: SectionVisibleItemValueMcnListItemListMcnResourcePreviewItemResourcePreview
id: str
formatuuid
cloud_type: Literal["AWS", "AZURE", "GOOGLE", "CLOUDFLARE"]
One of the following:
"AWS"
"AZURE"
"GOOGLE"
"CLOUDFLARE"
detail: str
name: str
resource_type: Literal["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: str
help_text: Optional[str]
state: Dict[str, object]
tags: Dict[str, str]
updated_at: str
url: str
managed_by: Optional[List[ManagedBy]]
id: str
formatuuid
client_type: Literal["MAGIC_WAN_CLOUD_ONRAMP"]
name: str

Read Resource

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
resource = client.magic_cloud_networking.resources.get(
    resource_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    account_id="account_id",
)
print(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
}