# Scans # Results ## Get the Latest Scan Result `cloudforce_one.scans.results.get(strconfig_id, ResultGetParams**kwargs) -> ResultGetResponse` **get** `/accounts/{account_id}/cloudforce-one/scans/results/{config_id}` Get the Latest Scan Result ### Parameters - `account_id: str` Defines the Account ID. - `config_id: str` Defines the Config ID. ### Returns - `class ResultGetResponse: …` - `_1_1_1_1: List[ScanResult]` - `number: Optional[float]` - `proto: Optional[str]` - `status: Optional[str]` ### 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 ) result = client.cloudforce_one.scans.results.get( config_id="config_id", account_id="account_id", ) print(result._1._1._1._1) ``` #### Response ```json { "errors": [ "string" ], "messages": [ "string" ], "result": { "1.1.1.1": [ { "number": 8080, "proto": "tcp", "status": "open" } ] }, "success": true } ``` ## Domain Types ### Scan Result - `class ScanResult: …` - `number: Optional[float]` - `proto: Optional[str]` - `status: Optional[str]` ### Result Get Response - `class ResultGetResponse: …` - `_1_1_1_1: List[ScanResult]` - `number: Optional[float]` - `proto: Optional[str]` - `status: Optional[str]` # Config ## List Scan Configs `cloudforce_one.scans.config.list(ConfigListParams**kwargs) -> SyncSinglePage[ConfigListResponse]` **get** `/accounts/{account_id}/cloudforce-one/scans/config` List Scan Configs ### Parameters - `account_id: str` Defines the Account ID. ### Returns - `class ConfigListResponse: …` - `id: str` Defines the Config ID. - `account_id: str` - `frequency: float` Defines the number of days between each scan (0 = One-off scan). - `ips: List[str]` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: List[str]` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### 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 ) page = client.cloudforce_one.scans.config.list( account_id="account_id", ) page = page.result[0] print(page.id) ``` #### 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": [ { "id": "uuid", "account_id": "abcd1234abcd1234abcd1234abcd1234", "frequency": 7, "ips": [ "1.1.1.1", "2606:4700:4700::1111" ], "ports": [ "default" ] } ] } ``` ## Create a new Scan Config `cloudforce_one.scans.config.create(ConfigCreateParams**kwargs) -> ConfigCreateResponse` **post** `/accounts/{account_id}/cloudforce-one/scans/config` Create a new Scan Config ### Parameters - `account_id: str` Defines the Account ID. - `ips: SequenceNotStr[str]` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `frequency: Optional[float]` Defines the number of days between each scan (0 = One-off scan). - `ports: Optional[SequenceNotStr[str]]` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### Returns - `class ConfigCreateResponse: …` - `id: str` Defines the Config ID. - `account_id: str` - `frequency: float` Defines the number of days between each scan (0 = One-off scan). - `ips: List[str]` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: List[str]` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### 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.cloudforce_one.scans.config.create( account_id="account_id", ips=["1.1.1.1", "2606:4700:4700::1111"], ) print(config.id) ``` #### 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": { "id": "uuid", "account_id": "abcd1234abcd1234abcd1234abcd1234", "frequency": 7, "ips": [ "1.1.1.1", "2606:4700:4700::1111" ], "ports": [ "default" ] } } ``` ## Update an existing Scan Config `cloudforce_one.scans.config.edit(strconfig_id, ConfigEditParams**kwargs) -> ConfigEditResponse` **patch** `/accounts/{account_id}/cloudforce-one/scans/config/{config_id}` Update an existing Scan Config ### Parameters - `account_id: str` Defines the Account ID. - `config_id: str` Defines the Config ID. - `frequency: Optional[float]` Defines the number of days between each scan (0 = One-off scan). - `ips: Optional[SequenceNotStr[str]]` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: Optional[SequenceNotStr[str]]` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### Returns - `class ConfigEditResponse: …` - `id: str` Defines the Config ID. - `account_id: str` - `frequency: float` Defines the number of days between each scan (0 = One-off scan). - `ips: List[str]` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: List[str]` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### 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 ) response = client.cloudforce_one.scans.config.edit( config_id="config_id", account_id="account_id", ) print(response.id) ``` #### 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": { "id": "uuid", "account_id": "abcd1234abcd1234abcd1234abcd1234", "frequency": 7, "ips": [ "1.1.1.1", "2606:4700:4700::1111" ], "ports": [ "default" ] } } ``` ## Delete a Scan Config `cloudforce_one.scans.config.delete(strconfig_id, ConfigDeleteParams**kwargs) -> object` **delete** `/accounts/{account_id}/cloudforce-one/scans/config/{config_id}` Delete a Scan Config ### Parameters - `account_id: str` Defines the Account ID. - `config_id: str` Defines the Config ID. ### 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.cloudforce_one.scans.config.delete( config_id="config_id", account_id="account_id", ) print(config) ``` #### Response ```json { "errors": [ "string" ], "messages": [ "string" ], "result": {}, "success": true } ``` ## Domain Types ### Config List Response - `class ConfigListResponse: …` - `id: str` Defines the Config ID. - `account_id: str` - `frequency: float` Defines the number of days between each scan (0 = One-off scan). - `ips: List[str]` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: List[str]` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### Config Create Response - `class ConfigCreateResponse: …` - `id: str` Defines the Config ID. - `account_id: str` - `frequency: float` Defines the number of days between each scan (0 = One-off scan). - `ips: List[str]` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: List[str]` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports. ### Config Edit Response - `class ConfigEditResponse: …` - `id: str` Defines the Config ID. - `account_id: str` - `frequency: float` Defines the number of days between each scan (0 = One-off scan). - `ips: List[str]` Defines a list of IP addresses or CIDR blocks to scan. The maximum number of total IP addresses allowed is 5000. - `ports: List[str]` Defines a list of ports to scan. Valid values are:"default", "all", or a comma-separated list of ports or range of ports (e.g. ["1-80", "443"]). "default" scans the 100 most commonly open ports.