UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

185 lines 5.43 kB
import * as Core from 'cloudflare/core'; import { APIResource } from 'cloudflare/resource'; import * as ACLsAPI from 'cloudflare/resources/magic-transit/sites/acls'; import { SinglePage } from 'cloudflare/pagination'; export declare class ACLs extends APIResource { /** * Creates a new Site ACL. */ create(siteId: string, params: ACLCreateParams, options?: Core.RequestOptions): Core.APIPromise<ACL>; /** * Update a specific Site ACL. */ update(siteId: string, aclIdentifier: string, params: ACLUpdateParams, options?: Core.RequestOptions): Core.APIPromise<ACL>; /** * Lists Site ACLs associated with an account. */ list(siteId: string, params: ACLListParams, options?: Core.RequestOptions): Core.PagePromise<ACLsSinglePage, ACL>; /** * Remove a specific Site ACL. */ delete(siteId: string, aclIdentifier: string, params: ACLDeleteParams, options?: Core.RequestOptions): Core.APIPromise<ACL>; /** * Get a specific Site ACL. */ get(siteId: string, aclIdentifier: string, params: ACLGetParams, options?: Core.RequestOptions): Core.APIPromise<ACL>; } export declare class ACLsSinglePage extends SinglePage<ACL> { } /** * Bidirectional ACL policy for network traffic within a site. */ export interface ACL { /** * Identifier */ id?: string; /** * Description for the ACL. */ description?: string; /** * The desired forwarding action for this ACL policy. If set to "false", the policy * will forward traffic to Cloudflare. If set to "true", the policy will forward * traffic locally on the Magic WAN Connector. If not included in request, will * default to false. */ forward_locally?: boolean; lan_1?: ACLConfiguration; lan_2?: ACLConfiguration; /** * The name of the ACL. */ name?: string; protocols?: Array<AllowedProtocol>; } export interface ACLConfiguration { /** * The identifier for the LAN you want to create an ACL policy with. */ lan_id: string; /** * The name of the LAN based on the provided lan_id. */ lan_name?: string; /** * Array of ports on the provided LAN that will be included in the ACL. If no ports * are provided, communication on any port on this LAN is allowed. */ ports?: Array<number>; /** * Array of subnet IPs within the LAN that will be included in the ACL. If no * subnets are provided, communication on any subnets on this LAN are allowed. */ subnets?: Array<Subnet>; } /** * Array of allowed communication protocols between configured LANs. If no * protocols are provided, all protocols are allowed. */ export type AllowedProtocol = 'tcp' | 'udp' | 'icmp'; /** * A valid IPv4 address. */ export type Subnet = string | string; export interface ACLCreateParams { /** * Path param: Identifier */ account_id: string; /** * Body param: */ lan_1: ACLConfiguration; /** * Body param: */ lan_2: ACLConfiguration; /** * Body param: The name of the ACL. */ name: string; /** * Body param: Description for the ACL. */ description?: string; /** * Body param: The desired forwarding action for this ACL policy. If set to * "false", the policy will forward traffic to Cloudflare. If set to "true", the * policy will forward traffic locally on the Magic WAN Connector. If not included * in request, will default to false. */ forward_locally?: boolean; /** * Body param: */ protocols?: Array<AllowedProtocol>; } export interface ACLUpdateParams { /** * Path param: Identifier */ account_id: string; /** * Body param: Description for the ACL. */ description?: string; /** * Body param: The desired forwarding action for this ACL policy. If set to * "false", the policy will forward traffic to Cloudflare. If set to "true", the * policy will forward traffic locally on the Magic WAN Connector. If not included * in request, will default to false. */ forward_locally?: boolean; /** * Body param: */ lan_1?: ACLConfiguration; /** * Body param: */ lan_2?: ACLConfiguration; /** * Body param: The name of the ACL. */ name?: string; /** * Body param: */ protocols?: Array<AllowedProtocol>; } export interface ACLListParams { /** * Identifier */ account_id: string; } export interface ACLDeleteParams { /** * Path param: Identifier */ account_id: string; /** * Body param: */ body: unknown; } export interface ACLGetParams { /** * Identifier */ account_id: string; } export declare namespace ACLs { export import ACL = ACLsAPI.ACL; export import ACLConfiguration = ACLsAPI.ACLConfiguration; export import AllowedProtocol = ACLsAPI.AllowedProtocol; export import Subnet = ACLsAPI.Subnet; export import ACLsSinglePage = ACLsAPI.ACLsSinglePage; export import ACLCreateParams = ACLsAPI.ACLCreateParams; export import ACLUpdateParams = ACLsAPI.ACLUpdateParams; export import ACLListParams = ACLsAPI.ACLListParams; export import ACLDeleteParams = ACLsAPI.ACLDeleteParams; export import ACLGetParams = ACLsAPI.ACLGetParams; } //# sourceMappingURL=acls.d.ts.map