(collections)
Endpoints related to the Collections product
- list - List Collections
- create - Create a Collection
- delete - Delete a Collection
- get - Get a Collection
- update - Update a Collection
- list_events - List a Collection's events
- aggregate - Search / Aggregate
- search - Search / Query
List Collections
from censys_platform import SDK
with SDK(
personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.collections.list(organization_id="<id>")
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
organization_id |
Optional[str] | ➖ | The ID of a Censys organization to associate the request with. See the Getting Started docs for more information. |
page_token |
Optional[str] | ➖ | page token for the requested page of collection results |
page_size |
Optional[int] | ➖ | amount of results to return per page |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.V3CollectionsCrudListResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorModel | 401, 403 | application/problem+json |
models.SDKError | 4XX, 5XX | */* |
Create a Collection
from censys_platform import SDK
with SDK(
personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.collections.create(organization_id="<id>")
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
organization_id |
Optional[str] | ➖ | The ID of a Censys organization to associate the request with. See the Getting Started docs for more information. |
crud_create_input_body |
Optional[models.CrudCreateInputBody] | ➖ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.V3CollectionsCrudCreateResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorModel | 401, 403 | application/problem+json |
models.SDKError | 4XX, 5XX | */* |
Delete a Collection
from censys_platform import SDK
with SDK(
personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.collections.delete(collection_uid="<id>", organization_id="<id>")
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
collection_uid |
str | ✔️ | The UID for the collection |
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. |
models.V3CollectionsCrudDeleteResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorModel | 401, 403 | application/problem+json |
models.SDKError | 4XX, 5XX | */* |
Get a Collection
from censys_platform import SDK
with SDK(
personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.collections.get(collection_uid="<id>", organization_id="<id>")
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
collection_uid |
str | ✔️ | The UID for the collection |
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. |
models.V3CollectionsCrudGetResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorModel | 401, 403 | application/problem+json |
models.SDKError | 4XX, 5XX | */* |
Update a Collection
from censys_platform import SDK
with SDK(
personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.collections.update(collection_uid="<id>", organization_id="<id>")
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
collection_uid |
str | ✔️ | The UID for the collection |
organization_id |
Optional[str] | ➖ | The ID of a Censys organization to associate the request with. See the Getting Started docs for more information. |
crud_update_input_body |
Optional[models.CrudUpdateInputBody] | ➖ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.V3CollectionsCrudUpdateResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorModel | 401, 403 | application/problem+json |
models.SDKError | 4XX, 5XX | */* |
List a Collection's events
from censys_platform import SDK
with SDK(
personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.collections.list_events(request={
"organization_id": "<id>",
"collection_uid": "<id>",
})
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
request |
models.V3CollectionsListEventsRequest | ✔️ | The request object to use for the request. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.V3CollectionsListEventsResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorModel | 401, 403 | application/problem+json |
models.SDKError | 4XX, 5XX | */* |
Run an aggregation via a Collection data set
from censys_platform import SDK
with SDK(
personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.collections.aggregate(collection_uid="<id>", search_aggregate_input_body={
"field": "<value>",
"number_of_buckets": 590414,
"query": "<value>",
}, organization_id="<id>")
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
collection_uid |
str | ✔️ | The UID for the collection |
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. |
models.V3CollectionsSearchAggregateResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorModel | 401, 403 | application/problem+json |
models.SDKError | 4XX, 5XX | */* |
Run a query via a Collection data set
from censys_platform import SDK
with SDK(
personal_access_token="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.collections.search(collection_uid="<id>", search_query_input_body={
"query": "<value>",
}, organization_id="<id>")
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
collection_uid |
str | ✔️ | The UID for the collection |
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. |
models.V3CollectionsSearchQueryResponse
Error Type | Status Code | Content Type |
---|---|---|
models.ErrorModel | 401, 403 | application/problem+json |
models.SDKError | 4XX, 5XX | */* |