scrapy_cloud_ex v0.1.0 ScrapyCloudEx.Endpoints.Storage.Activity View Source
Wraps the Activity endpoint.
Scrapinghub keeps track of certain project events such as when spiders are run or new spiders are deployed. This activity log can be accessed in the dashboard by clicking on Activity in the left sidebar, or programmatically through the API in this module.
Link to this section Summary
Types
An event
Link to this section Types
An event.
Map with the following keys:
"event"
- type of event (String.t/0
)."user"
- user having triggered the event (String.t/0
).
Other key-values may be present as relevant to the "event"
type.
Link to this section Functions
list(String.t(), String.t() | integer(), Keyword.t(), Keyword.t()) :: ScrapyCloudEx.result([event_object()])
Retrieves messages for the specified project.
Results are returned in reverse order.
The following parameters are supported in the params
argument:
:pagination
- the:count
pagination parameter is supported.
The opts
value is documented here.
See docs here (GET method).
Example
ScrapyCloudEx.Endpoints.Storage.Activity.list("API_KEY", "123", count: 10)
projects(String.t(), Keyword.t(), Keyword.t()) :: ScrapyCloudEx.result([event_object()])
Retrieves messages for multiple projects.
Results are returned in reverse order.
The following parameters are supported in the params
argument:
:format
- the format to be used for returning results. Must be one of:json
,:csv
,:jl
,:xml
. Defaults to:json
. See more about formats inScrapyCloudEx.Endpoints.Storage
.:pagination
- pagination parameters.:meta
- meta parameters to add to each result. Supported values::_project
,:_ts
.:p
- project id. May be given multiple times.:pcount
- maximum number of results to return per project.
The opts
value is documented here.
See docs here.
Example
params = [p: "123", p: "456", pcount: 15, pagination: [count: 100], meta: [:_ts, :_project]]
ScrapyCloudEx.Endpoints.Storage.Activity.projects("API_KEY", params)