v1
latestOpenAPI 3.0.12026-07-17221165.2 KBCreates a context for live sampling
To create a context for live sampling, a web client can access any /pmapi URL (optionally using the hostspec or context parameter). If no context exists, a new one will be created for that web client, and its identifier returned for future accesses.
However, /pmapi/context is provided as a dedicated URL for applications wishing to explicitly create the contexts they use.
$ curl -s http://localhost:44322/pmapi/context?hostspec=www.acme.com&polltimeout=0.5 | pmjson
The context (a 32-bit unsigned decimal number) can then be used with all later requests.
In the case of a hostspec containing authentication information, such as a username, the server will follow the HTTP Basic Authentication protocol to ascertain necessary authentication details from the user, providing the client web application an opportunity to request these from the user.
Reference: pmNewContext(3)
Query parameters
Host specification as described in PCPIntro(1)
Seconds of inactivity before closing context
Request identifier sent back with response
Response
OK