Cloudflare
Akun, zone, DNS record (agent hanya bisa membuat atau mengubah nama yang diizinkan, hapus hanya lewat node), purge cache (hanya lewat node), Workers beserta pengaturan dan deployment-nya
Beta v0.1.0 Node.js 15 aksi
Tentang
Plugin Graphrt untuk Cloudflare API v4. Plugin ini membaca akun dan zone, menampilkan dan mengubah DNS record, mem-purge cache dari node workflow, dan menampilkan Workers beserta pengaturan dan deployment-nya. Dibuat dengan lapisan REST deklaratif (definition.mjs).
Yang bisa dilakukan
- Token, accounts, zones: verify_token (user tokens), verify_account_token (account-owned tokens, which verify_token rejects), list_accounts, list_zones, get_zone
- DNS: list_dns_records, get_dns_record, create_dns_record, update_dns_record, delete_dns_record (node only)
- Cache: purge_cache (node only): everything, or by URLs, cache tags, hostnames or prefixes
- Workers: list_workers, get_worker_settings (bindings by name and type, secret values are never returned), list_worker_deployments
- api_request: any other v4 endpoint, e.g. /zones/<zone_id>/settings (agents: GET only, on an allowlist)
Aksi
Setiap aksi adalah langkah yang bisa ditambahkan ke workflow. Agent juga bisa memakai sebagian besar aksi sebagai tool.
- Verify API token
cloudflare.verify_token - Verify account API token
cloudflare.verify_account_token - List accounts
cloudflare.list_accounts - List zones
cloudflare.list_zones - Get zone
cloudflare.get_zone - List DNS records
cloudflare.list_dns_records - Get DNS record
cloudflare.get_dns_record - Create DNS record
cloudflare.create_dns_record - Update DNS record
cloudflare.update_dns_record - Delete DNS record
cloudflare.delete_dns_record
Tampilkan semua 15 aksi
- Purge cache
cloudflare.purge_cache - List Workers
cloudflare.list_workers - Get Worker settings
cloudflare.get_worker_settings - List Worker deployments
cloudflare.list_worker_deployments - Cloudflare API request
cloudflare.api_request
Pengaturan
Graphrt menyalakan plugin dengan environment yang bersih. Hanya nilai ini yang sampai ke plugin, dan secret tidak masuk log.
-
CLOUDFLARE_API_TOKENWajibAPI token (Authorization: Bearer). Global API keys are not supported. -
CLOUDFLARE_TOOL_ALLOW_WRITEOpsional1 lets agent tools create and update DNS records named in the next variable -
CLOUDFLARE_TOOL_DNS_ALLOWED_NAMESFor tool DNS writesDNS names agents may create/update: api.example.com, *.preview.example.com -
CLOUDFLARE_TOOL_API_EXTRA_PATHSOpsionalMore read paths for agent api_request, comma-separated, * = one segment
Cara memakainya
Di Graphrt Desktop
- Buka Plugins dan cari Cloudflare.
- Klik Install lalu setujui.
- Ikuti langkah setup di halaman plugin, lalu tempel pengaturan yang dibutuhkan.
- Jelaskan pekerjaan yang membutuhkannya, dan builder menambahkan langkahnya.
Dengan CLI
terminal
$ graphrt plugin install cloudflare workflow.yaml
- id: zone
type: cloudflare.list_zones
name: example.com
- id: record
type: cloudflare.list_dns_records
zone_id: "{{#zone.data.0.id#}}"
record_type: A
name: api.example.com
- id: repoint
type: cloudflare.update_dns_record
zone_id: "{{#zone.data.0.id#}}"
record_id: "{{#record.data.0.id#}}"
content: 198.51.100.7