- Home
- Resources
- LocalAgentResource
LocalAgentResource is com.ptc.sc.rest.SCResource designed
to provide disconnected-related information to the client applications.
Note: that this resource is available only when communicating over local communication
(i.e. points to "localhost").
Any attempt to access this one outside of the localhost will result in 403 - blocked.
Supported API: false
Extendable: false
The following resources are applicable:
GET /local_agent/state
Returns a comprehensive disconnected state map.
Returned value contains a lot of information required in the client side
in order to properly update UI state as well as to react upon certain events
like errors etc.
For more information go to {@link com.ptc.sc.servicecommon.LocalAgentStateService#getState()} to
see full list of returned values
Error description:
- @HTTP 403 - if Host of the request was not localhost
Request Parameters
name |
type |
description |
default |
getCartStatusOnly |
query |
|
n/a |
Response Body
media type |
data type |
application/vnd.ptc.sc+json |
SCItem
(JSON) |
POST /local_agent/downloads
Starts {@code download} operation. Download operation refers to the downloading
of all available segments as defined by underlying business services (check see section
of this documentation).
Method builds a successful response containing an information about all segments that
were actually placed in the download queue. Therefore client is immediately informed
whether or not this download process was started or not.
Note that this method returns immediately in order to keep client unblocked,
therefore allows to continue the work by user. In order to verify the progress of the download
process refer to the properties returned via
{@link #state(javax.ws.rs.core.HttpHeaders, javax.servlet.http.HttpServletRequest )}
Error description:
- 500 - any uncaught exception may result in 500
- 403 - if Host of the request was not localhost
Request Body
media type |
data type |
application/vnd.ptc.sc+json |
SCList
(JSON) |
Response Body
media type |
data type |
application/vnd.ptc.sc+json |
object
(JSON) |
POST /local_agent/downloads/pause
Pauses {@code download} process by calling {@link com.ptc.sc.servicecommon.LocalAgentStateService#pauseDownloading()}.
This method returns immediately to left client unblocked.
Error description:
- 500 - any uncaught exception may result in 500
- 403 - if Host of the request was not localhost
Response Body
media type |
data type |
application/vnd.ptc.sc+json |
SCItem
(JSON) |
POST /local_agent/installations
Initiates {@code install} process for all {@code segments} (download prior to installation) that are
candidates to be installed (as defined in {@link com.ptc.sc.servicecommon.InstallService}).
Method builds a successful response containing an information about all segments that
were actually placed in the install queue after they were downloaded. Therefore client is immediately informed
whether or not this install process was started or not.
Note that this method returns immediately in order to keep client unblocked.
In order to verify the progress check
{@link #state(javax.ws.rs.core.HttpHeaders, javax.servlet.http.HttpServletRequest)}.
Error description:
- 500 - any uncaught exception may result in 500
- 403 - if Host of the request was not localhost
Response Body
media type |
data type |
application/vnd.ptc.sc+json |
SCItem
(JSON) |
POST /local_agent/install/stop
Response Body
media type |
data type |
application/vnd.ptc.sc+json |
SCItem
(JSON) |
POST /local_agent/install/skip
Response Body
media type |
data type |
application/vnd.ptc.sc+json |
SCItem
(JSON) |
POST /local_agent/preference
Request Body
media type |
data type |
application/vnd.ptc.sc+json |
SCItem
(JSON) |
Response Body
media type |
data type |
application/vnd.ptc.sc+json |
SCItem
(JSON) |
GET /local_agent/directories
Verifies if path passed as {@link javax.ws.rs.QueryParam} and interpreted as absolute directory path
exits on the local/technician/user operating system.
This method skips the gap between browser and operating system, hence impossibility to access file system
from JS. Therefore it is potentially vulnerable and poses security threat.
Dangerous end point, revise and decide how to make it even better secured
Request Parameters
name |
type |
description |
default |
path |
query |
|
n/a |
Response Body
media type |
data type |
application/vnd.ptc.sc+json |
string
(JSON) |
GET /local_agent/connection
That end point is using only to check connection between example disconnected system and web
Ping is not enough because it is available when jboss is running but resources do not up yet.
Response Body
media type |
data type |
application/vnd.ptc.sc+json |
object
(JSON) |