# Control # Retention ## Get log retention flag `logs.control.retention.get(RetentionGetParams**kwargs) -> RetentionGetResponse` **get** `/zones/{zone_id}/logs/control/retention/flag` Gets log retention flag for Logpull API. ### Parameters - `zone_id: str` Identifier. ### Returns - `class RetentionGetResponse: …` - `flag: Optional[bool]` The log retention flag for Logpull API. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) retention = client.logs.control.retention.get( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(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 `logs.control.retention.create(RetentionCreateParams**kwargs) -> RetentionCreateResponse` **post** `/zones/{zone_id}/logs/control/retention/flag` Updates log retention flag for Logpull API. ### Parameters - `zone_id: str` Identifier. - `flag: Optional[bool]` The log retention flag for Logpull API. ### Returns - `class RetentionCreateResponse: …` - `flag: Optional[bool]` The log retention flag for Logpull API. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) retention = client.logs.control.retention.create( zone_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(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 - `class RetentionGetResponse: …` - `flag: Optional[bool]` The log retention flag for Logpull API. ### Retention Create Response - `class RetentionCreateResponse: …` - `flag: Optional[bool]` The log retention flag for Logpull API. # Cmb # Config ## Get CMB config `logs.control.cmb.config.get(ConfigGetParams**kwargs) -> CmbConfig` **get** `/accounts/{account_id}/logs/control/cmb/config` Gets CMB config. ### Parameters - `account_id: str` Identifier. ### Returns - `class CmbConfig: …` - `allow_out_of_region_access: Optional[bool]` Allow out of region access - `regions: Optional[str]` Name of the region. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) cmb_config = client.logs.control.cmb.config.get( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(cmb_config.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 `logs.control.cmb.config.create(ConfigCreateParams**kwargs) -> CmbConfig` **post** `/accounts/{account_id}/logs/control/cmb/config` Updates CMB config. ### Parameters - `account_id: str` Identifier. - `allow_out_of_region_access: Optional[bool]` Allow out of region access - `regions: Optional[str]` Name of the region. ### Returns - `class CmbConfig: …` - `allow_out_of_region_access: Optional[bool]` Allow out of region access - `regions: Optional[str]` Name of the region. ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) cmb_config = client.logs.control.cmb.config.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(cmb_config.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 `logs.control.cmb.config.delete(ConfigDeleteParams**kwargs) -> object` **delete** `/accounts/{account_id}/logs/control/cmb/config` Deletes CMB config. ### Parameters - `account_id: str` Identifier. ### Returns - `object` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) config = client.logs.control.cmb.config.delete( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(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 - `class CmbConfig: …` - `allow_out_of_region_access: Optional[bool]` Allow out of region access - `regions: Optional[str]` Name of the region.