Skip to content
Start here

Export Resources

magic_cloud_networking.resources.export(ResourceExportParams**kwargs) -> BinaryResponseContent
GET/accounts/{account_id}/magic/cloud/resources/export

Export resources in the Resource Catalog as a JSON file (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
desc: Optional[bool]
order_by: Optional[str]

One of [“id”, “resource_type”, “region”].

provider_id: Optional[str]
region: Optional[str]
resource_group: Optional[str]
resource_id: Optional[Sequence[str]]
resource_type: Optional[List[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"
v2: Optional[bool]
ReturnsExpand Collapse
BinaryResponseContent

Export Resources

import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
response = client.magic_cloud_networking.resources.export(
    account_id="account_id",
)
print(response)
content = response.read()
print(content)
Returns Examples