# Control # Retention ## Get log retention flag `client.logs.control.retention.get(RetentionGetParamsparams, RequestOptionsoptions?): RetentionGetResponse | null` **get** `/zones/{zone_id}/logs/control/retention/flag` Gets log retention flag for Logpull API. ### Parameters - `params: RetentionGetParams` - `zone_id: string` Identifier. ### Returns - `RetentionGetResponse` - `flag?: boolean` The log retention flag for Logpull API. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const retention = await client.logs.control.retention.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(retention.flag); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "flag": true } } ``` ## Update log retention flag `client.logs.control.retention.create(RetentionCreateParamsparams, RequestOptionsoptions?): RetentionCreateResponse | null` **post** `/zones/{zone_id}/logs/control/retention/flag` Updates log retention flag for Logpull API. ### Parameters - `params: RetentionCreateParams` - `zone_id: string` Path param: Identifier. - `flag?: boolean` Body param: The log retention flag for Logpull API. ### Returns - `RetentionCreateResponse` - `flag?: boolean` The log retention flag for Logpull API. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const retention = await client.logs.control.retention.create({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(retention.flag); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "flag": true } } ``` ## Domain Types ### Retention Get Response - `RetentionGetResponse` - `flag?: boolean` The log retention flag for Logpull API. ### Retention Create Response - `RetentionCreateResponse` - `flag?: boolean` The log retention flag for Logpull API. # Cmb # Config ## Get CMB config `client.logs.control.cmb.config.get(ConfigGetParamsparams, RequestOptionsoptions?): CmbConfig | null` **get** `/accounts/{account_id}/logs/control/cmb/config` Gets CMB config. ### Parameters - `params: ConfigGetParams` - `account_id: string` Identifier. ### Returns - `CmbConfig | null` - `allow_out_of_region_access?: boolean` Allow out of region access - `regions?: string` Name of the region. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const cmbConfig = await client.logs.control.cmb.config.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(cmbConfig.allow_out_of_region_access); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "allow_out_of_region_access": false, "regions": "eu" } } ``` ## Update CMB config `client.logs.control.cmb.config.create(ConfigCreateParamsparams, RequestOptionsoptions?): CmbConfig | null` **post** `/accounts/{account_id}/logs/control/cmb/config` Updates CMB config. ### Parameters - `params: ConfigCreateParams` - `account_id: string` Path param: Identifier. - `allow_out_of_region_access?: boolean` Body param: Allow out of region access - `regions?: string` Body param: Name of the region. ### Returns - `CmbConfig | null` - `allow_out_of_region_access?: boolean` Allow out of region access - `regions?: string` Name of the region. ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const cmbConfig = await client.logs.control.cmb.config.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(cmbConfig.allow_out_of_region_access); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "allow_out_of_region_access": false, "regions": "eu" } } ``` ## Delete CMB config `client.logs.control.cmb.config.delete(ConfigDeleteParamsparams, RequestOptionsoptions?): ConfigDeleteResponse | null` **delete** `/accounts/{account_id}/logs/control/cmb/config` Deletes CMB config. ### Parameters - `params: ConfigDeleteParams` - `account_id: string` Identifier. ### Returns - `ConfigDeleteResponse = unknown` ### Example ```node import Cloudflare from 'cloudflare'; const client = new Cloudflare({ apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const config = await client.logs.control.cmb.config.delete({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); console.log(config); ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": {} } ``` ## Domain Types ### Cmb Config - `CmbConfig` - `allow_out_of_region_access?: boolean` Allow out of region access - `regions?: string` Name of the region. ### Config Delete Response - `ConfigDeleteResponse = unknown`