Skip to content

Latest commit

 

History

History
393 lines (254 loc) · 45.7 KB

README.md

File metadata and controls

393 lines (254 loc) · 45.7 KB

GlobalData

(global_data)

Overview

Endpoints related to the Global Data product

Available Operations

get_certificates

Get multiple Certificates

Example Usage

from censys_platform import SDK


with SDK(
    personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.global_data.get_certificates(certificate_ids=[
        "<value>",
    ], organization_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
certificate_ids List[str] ✔️ A list of SHA-256 certificate fingerprints.
organization_id Optional[str] The ID of a Censys organization to associate the request with. See the Getting Started docs for more information.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.V3GlobaldataAssetCertificateListResponse

Errors

Error Type Status Code Content Type
models.ErrorModel 401, 403 application/problem+json
models.SDKError 4XX, 5XX */*

get_certificate

Get a Certificate

Example Usage

from censys_platform import SDK


with SDK(
    personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.global_data.get_certificate(certificate_id="<id>", organization_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
certificate_id str ✔️ The SHA-256 certificate fingerprint.
organization_id Optional[str] The ID of a Censys organization to associate the request with. See the Getting Started docs for more information.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.V3GlobaldataAssetCertificateResponse

Errors

Error Type Status Code Content Type
models.ErrorModel 401, 403 application/problem+json
models.SDKError 4XX, 5XX */*

get_hosts

Get multiple Hosts

Example Usage

from censys_platform import SDK


with SDK(
    personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.global_data.get_hosts(host_ids=[], organization_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
host_ids List[str] ✔️ A list of host IP addresses.
organization_id Optional[str] The ID of a Censys organization to associate the request with. See the Getting Started docs for more information.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.V3GlobaldataAssetHostListResponse

Errors

Error Type Status Code Content Type
models.ErrorModel 401, 403 application/problem+json
models.SDKError 4XX, 5XX */*

get_host

Get a Host

Example Usage

from censys_platform import SDK


with SDK(
    personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.global_data.get_host(host_id="<id>", organization_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
host_id str ✔️ The IP address of a host.
organization_id Optional[str] The ID of a Censys organization to associate the request with. See the Getting Started docs for more information.
at_time date RFC3339 Timestamp to view a host at a specific point in time. Must be a valid RFC3339 string. Ensure that you suffix the date with T00:00:00Z or a specific time.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.V3GlobaldataAssetHostResponse

Errors

Error Type Status Code Content Type
models.ErrorModel 401, 403 application/problem+json
models.SDKError 4XX, 5XX */*

get_host_timeline

Get the timeline of events for a Host

Example Usage

from censys_platform import SDK
import dateutil.parser


with SDK(
    personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.global_data.get_host_timeline(host_id="<id>", start_time=dateutil.parser.isoparse("2024-04-27T09:30:08.024Z"), end_time=dateutil.parser.isoparse("2023-04-13T10:41:42.221Z"), organization_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
host_id str ✔️ The IP address of a host.
start_time date ✔️ Start time of the host timeline. Must be a valid RFC3339 string. Ensure that you suffix the date with T00:00:00Z or a specific time.
end_time date ✔️ End time of the host timeline. Must be a valid RFC3339 string. Ensure that you suffix the date with T00:00:00Z or a specific time.
organization_id Optional[str] The ID of a Censys organization to associate the request with. See the Getting Started docs for more information.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.V3GlobaldataAssetHostTimelineResponse

Errors

Error Type Status Code Content Type
models.ErrorModel 401, 403 application/problem+json
models.SDKError 4XX, 5XX */*

get_web_properties

Get multiple WebProperties

Example Usage

from censys_platform import SDK


with SDK(
    personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.global_data.get_web_properties(webproperty_ids=[
        "<value>",
    ], organization_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
webproperty_ids List[str] ✔️ A web property host identifier, the format is hostname:port.
organization_id Optional[str] The ID of a Censys organization to associate the request with. See the Getting Started docs for more information.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.V3GlobaldataAssetWebpropertyListResponse

Errors

Error Type Status Code Content Type
models.ErrorModel 401, 403 application/problem+json
models.SDKError 4XX, 5XX */*

get_web_property

Get a WebProperty

Example Usage

from censys_platform import SDK


with SDK(
    personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.global_data.get_web_property(webproperty_id="<id>", organization_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
webproperty_id str ✔️ A web property host identifier, the format is hostname:port.
organization_id Optional[str] The ID of a Censys organization to associate the request with. See the Getting Started docs for more information.
at_time date RFC3339 Timestamp to view a webproperty at a specific point in time. Must be a valid RFC3339 string. Ensure that you suffix the date with T00:00:00Z or a specific time
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.V3GlobaldataAssetWebpropertyResponse

Errors

Error Type Status Code Content Type
models.ErrorModel 401, 403 application/problem+json
models.SDKError 4XX, 5XX */*

aggregate

Run an aggregation via the Global data set

Example Usage

from censys_platform import SDK


with SDK(
    personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.global_data.aggregate(search_aggregate_input_body={
        "field": "<value>",
        "number_of_buckets": 590414,
        "query": "<value>",
    }, organization_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
search_aggregate_input_body models.SearchAggregateInputBody ✔️ N/A
organization_id Optional[str] The ID of a Censys organization to associate the request with. See the Getting Started docs for more information.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.V3GlobaldataSearchAggregateResponse

Errors

Error Type Status Code Content Type
models.ErrorModel 401, 403 application/problem+json
models.SDKError 4XX, 5XX */*

search

Search the Global data set

Example Usage

from censys_platform import SDK


with SDK(
    personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.global_data.search(search_query_input_body={
        "query": "<value>",
    }, organization_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
search_query_input_body models.SearchQueryInputBody ✔️ N/A
organization_id Optional[str] The ID of a Censys organization to associate the request with. See the Getting Started docs for more information.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.V3GlobaldataSearchQueryResponse

Errors

Error Type Status Code Content Type
models.ErrorModel 401, 403 application/problem+json
models.SDKError 4XX, 5XX */*