# Agents

## List

> Retrieve RAS Agent(s) information.

```json
{"openapi":"3.0.1","info":{"title":"Parallels RAS - REST API v1.0","version":"1.0"},"paths":{"/api/Agent":{"get":{"tags":["0-Infrastructure//Agents"],"summary":"List","description":"Retrieve RAS Agent(s) information.","operationId":"ca476110-d2a0-45b5-ba6f-4259025e8985","parameters":[{"name":"siteId","in":"query","description":"Site ID for which to retrieve RAS Agent information.","schema":{"type":"integer","format":"int32"}},{"name":"serverType","in":"query","description":"Server type for which to retrieve the information.","schema":{"$ref":"#/components/schemas/RASServerType"}}],"responses":{"200":{"description":"Success","content":{"application/json; api-version=1.0":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RASAgentInfo"}}}}},"401":{"description":"Unauthorized","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not Found","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"RASServerType":{"enum":[["1 = RDSHost","2 = Provider","3 = Gateway","4 = Guest","7 = Broker","9 = Site","10 = VDIHostPool","16 = RDSGroup","25 = HALBDevice","45 = TenantBroker","46 = Enrollment","51 = HALB","64 = AVDWorkspace","65 = AVDHostPool","66 = AVDTemplate","67 = AVDHost","95 = VDITemplateVersion","96 = AVDTemplateVersion","97 = RDSTemplateVersion","107 = RDSTemplate","108 = VDITemplate","2013 = VDIHost","-1 = All"]],"type":"string","description":"<para type=\"synopsis\">RAS Status Type</para>\r\n<para type=\"description\"></para>","format":"int32"},"RASAgentInfo":{"type":"object","properties":{"id":{"type":"string","description":"<para type=\"description\">ID of RAS Agent.</para>","nullable":true},"siteId":{"type":"integer","description":"<para type=\"description\">ID of Site.</para>","format":"int32"},"agentState":{"$ref":"#/components/schemas/AgentState"},"serverType":{"$ref":"#/components/schemas/RASServerType"}},"additionalProperties":false,"description":"<para type=\"synopsis\">RAS Agent Info</para>\r\n<para type=\"description\"></para>"},"AgentState":{"enum":[["0 = OK","1 = EnumSessionsFailed","2 = RDSRoleDisabled","3 = MaxNonCompletedSessions","4 = RASScheduleInProgress","5 = ConnectionFailed","6 = InvalidCredentials","7 = NeedsSysprep","8 = SysPrepInProgress","9 = CloningFailed","10 = Synchronising","13 = LogonDrainUntilRestart","14 = LogonDrain","15 = LogonDisabled","16 = ForcedDisconnect","17 = CloningCanceled","18 = RASprepInProgress","20 = InstallingRDSRole","21 = RebootPending","22 = PortMismatch","23 = NeedsDowngrade","24 = NotApplied","25 = CloningInProgress","26 = MarkedForDeletion","27 = StandBy","28 = UnsupportedVDIType","29 = FreeESXLicenseNotSupported","30 = ManagedESXNotSupported","32 = InvalidHostVersion","33 = NotJoined","35 = LicenseExpired","36 = JoinBroken","37 = InUse","38 = NotInUse","39 = Unsupported","40 = NoAvailableGateways","41 = EnrollServerNotInitialized","42 = EnrollmentUnavailable","43 = InvalidCAConfig","44 = InvalidEAUserCredentials","45 = InvalidESSettings","46 = FSLogixNotAvail","47 = NoDevices","48 = NeedsAttention","49 = ImageOptimizationPending","50 = ImageOptimization","51 = Unavailable","52 = UnderConstruction","53 = Broken","54 = NonRAS","55 = Provisioning","56 = Invalid","57 = FSLogixNeedsUpdate","58 = NoMembersAvailable","59 = MembersNeedUpdate","60 = FailedPerfCounters","61 = PendingRecreation","62 = RemovingMembers","63 = AddingMembers","64 = DeleteInProgress","65 = RestrictedAddress","66 = JoiningToHostPool","67 = AutoUpgradeInProgress","68 = AutoUpgradeInitiated","69 = ReplicaMigrationInProgress","70 = InvalidRegistrationCertificate","1006 = AzureStateInstallGuestAgent","-8 = AutoUpgradeLimitReached","-7 = AutoUpgradeFailed","-6 = Unknown","-5 = NeedsUpdate","-4 = NotVerified","-3 = ServerDeleted","-2 = DisabledFromSettings","-1 = Disconnected"]],"type":"string","description":"<para type=\"synopsis\">Agent State</para>\r\n<para type=\"description\"></para>","format":"int32"},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```

## Update

> Modify RAS Agent.

```json
{"openapi":"3.0.1","info":{"title":"Parallels RAS - REST API v1.0","version":"1.0"},"paths":{"/api/Agent":{"put":{"tags":["0-Infrastructure//Agents"],"summary":"Update","description":"Modify RAS Agent.","operationId":"1b0fc5d1-d44f-4f51-9440-885ed3d66f73","parameters":[{"name":"server","in":"query","description":"RAS Agent Server name","schema":{"type":"string"}},{"name":"siteId","in":"query","description":"Site ID in which to modify the specified server.","schema":{"type":"integer","format":"int32"}},{"name":"force","in":"query","description":"When 'Force' is passed, only the known info will be used and force the operation.","schema":{"type":"boolean"}},{"name":"username","in":"query","description":"An administrator account to remotely perform operation on the RAS agent from the server.","schema":{"type":"string"}},{"name":"password","in":"query","description":"The password of the account specified in the Username parameter.","schema":{"type":"string"}}],"requestBody":{"description":"RAS Agent server","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ExecuteAgent"}}}},"responses":{"204":{"description":"No Content"},"401":{"description":"Unauthorized","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not Found","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"ExecuteAgent":{"required":["server"],"type":"object","properties":{"server":{"type":"string","description":"<para type=\"description\">The name of the RAS agent server.</para>\r\n<para type=\"description\">The name can be either FQDN or IP address, but you have to enter the actual name this server has in the RAS farm.</para>","nullable":true},"force":{"type":"boolean","description":"<para type=\"description\">When 'Force' is passed, only the known info will be used and force the operation.</para>\r\n<para type=\"description\">If the parameter is omitted, the RAS Agent info is retrieved with the supplied info.</para>","default":false}},"additionalProperties":false,"description":"<para type=\"synopsis\">Execute an action in a RAS Agent</para>"},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```

## Delete

> Remove RAS Agent.

```json
{"openapi":"3.0.1","info":{"title":"Parallels RAS - REST API v1.0","version":"1.0"},"paths":{"/api/Agent":{"delete":{"tags":["0-Infrastructure//Agents"],"summary":"Delete","description":"Remove RAS Agent.","operationId":"55a6fd3b-a85d-4c07-b277-ee5a1e1174c6","parameters":[{"name":"server","in":"query","description":"RAS Agent Server name","schema":{"type":"string"}},{"name":"siteId","in":"query","description":"Site ID from which to delete the specified server.","schema":{"type":"integer","format":"int32"}},{"name":"force","in":"query","description":"When 'Force' is passed, only the known info will be used and force the operation.","schema":{"type":"boolean"}},{"name":"username","in":"query","description":"An administrator account to remotely perform operation on the RAS agent from the server.","schema":{"type":"string"}},{"name":"password","in":"query","description":"The password of the account specified in the Username parameter.","schema":{"type":"string"}}],"requestBody":{"description":"RAS Agent server","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ExecuteAgent"}}}},"responses":{"204":{"description":"No Content"},"401":{"description":"Unauthorized","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not Found","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"ExecuteAgent":{"required":["server"],"type":"object","properties":{"server":{"type":"string","description":"<para type=\"description\">The name of the RAS agent server.</para>\r\n<para type=\"description\">The name can be either FQDN or IP address, but you have to enter the actual name this server has in the RAS farm.</para>","nullable":true},"force":{"type":"boolean","description":"<para type=\"description\">When 'Force' is passed, only the known info will be used and force the operation.</para>\r\n<para type=\"description\">If the parameter is omitted, the RAS Agent info is retrieved with the supplied info.</para>","default":false}},"additionalProperties":false,"description":"<para type=\"synopsis\">Execute an action in a RAS Agent</para>"},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```

## Get

> Retrieve RAS Agent(s) information.

```json
{"openapi":"3.0.1","info":{"title":"Parallels RAS - REST API v1.0","version":"1.0"},"paths":{"/api/Agent/{server}":{"get":{"tags":["0-Infrastructure//Agents"],"summary":"Get","description":"Retrieve RAS Agent(s) information.","operationId":"ef688231-0dd3-4b88-8d9a-aaf8b1503c5e","parameters":[{"name":"server","in":"path","description":"RAS Agent Server name","required":true,"schema":{"type":"string"}},{"name":"siteId","in":"query","description":"Site ID for which to retrieve RAS Agent information.","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Success","content":{"application/json; api-version=1.0":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RASAgentInfo"}}}}},"401":{"description":"Unauthorized","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}},"404":{"description":"Not Found","content":{"application/json; api-version=1.0":{"schema":{"$ref":"#/components/schemas/ProblemDetails"}}}}}}}},"components":{"schemas":{"RASAgentInfo":{"type":"object","properties":{"id":{"type":"string","description":"<para type=\"description\">ID of RAS Agent.</para>","nullable":true},"siteId":{"type":"integer","description":"<para type=\"description\">ID of Site.</para>","format":"int32"},"agentState":{"$ref":"#/components/schemas/AgentState"},"serverType":{"$ref":"#/components/schemas/RASServerType"}},"additionalProperties":false,"description":"<para type=\"synopsis\">RAS Agent Info</para>\r\n<para type=\"description\"></para>"},"AgentState":{"enum":[["0 = OK","1 = EnumSessionsFailed","2 = RDSRoleDisabled","3 = MaxNonCompletedSessions","4 = RASScheduleInProgress","5 = ConnectionFailed","6 = InvalidCredentials","7 = NeedsSysprep","8 = SysPrepInProgress","9 = CloningFailed","10 = Synchronising","13 = LogonDrainUntilRestart","14 = LogonDrain","15 = LogonDisabled","16 = ForcedDisconnect","17 = CloningCanceled","18 = RASprepInProgress","20 = InstallingRDSRole","21 = RebootPending","22 = PortMismatch","23 = NeedsDowngrade","24 = NotApplied","25 = CloningInProgress","26 = MarkedForDeletion","27 = StandBy","28 = UnsupportedVDIType","29 = FreeESXLicenseNotSupported","30 = ManagedESXNotSupported","32 = InvalidHostVersion","33 = NotJoined","35 = LicenseExpired","36 = JoinBroken","37 = InUse","38 = NotInUse","39 = Unsupported","40 = NoAvailableGateways","41 = EnrollServerNotInitialized","42 = EnrollmentUnavailable","43 = InvalidCAConfig","44 = InvalidEAUserCredentials","45 = InvalidESSettings","46 = FSLogixNotAvail","47 = NoDevices","48 = NeedsAttention","49 = ImageOptimizationPending","50 = ImageOptimization","51 = Unavailable","52 = UnderConstruction","53 = Broken","54 = NonRAS","55 = Provisioning","56 = Invalid","57 = FSLogixNeedsUpdate","58 = NoMembersAvailable","59 = MembersNeedUpdate","60 = FailedPerfCounters","61 = PendingRecreation","62 = RemovingMembers","63 = AddingMembers","64 = DeleteInProgress","65 = RestrictedAddress","66 = JoiningToHostPool","67 = AutoUpgradeInProgress","68 = AutoUpgradeInitiated","69 = ReplicaMigrationInProgress","70 = InvalidRegistrationCertificate","1006 = AzureStateInstallGuestAgent","-8 = AutoUpgradeLimitReached","-7 = AutoUpgradeFailed","-6 = Unknown","-5 = NeedsUpdate","-4 = NotVerified","-3 = ServerDeleted","-2 = DisabledFromSettings","-1 = Disconnected"]],"type":"string","description":"<para type=\"synopsis\">Agent State</para>\r\n<para type=\"description\"></para>","format":"int32"},"RASServerType":{"enum":[["1 = RDSHost","2 = Provider","3 = Gateway","4 = Guest","7 = Broker","9 = Site","10 = VDIHostPool","16 = RDSGroup","25 = HALBDevice","45 = TenantBroker","46 = Enrollment","51 = HALB","64 = AVDWorkspace","65 = AVDHostPool","66 = AVDTemplate","67 = AVDHost","95 = VDITemplateVersion","96 = AVDTemplateVersion","97 = RDSTemplateVersion","107 = RDSTemplate","108 = VDITemplate","2013 = VDIHost","-1 = All"]],"type":"string","description":"<para type=\"synopsis\">RAS Status Type</para>\r\n<para type=\"description\"></para>","format":"int32"},"ProblemDetails":{"type":"object","properties":{"type":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"status":{"type":"integer","format":"int32","nullable":true},"detail":{"type":"string","nullable":true},"instance":{"type":"string","nullable":true}},"additionalProperties":{}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.parallels.com/landing/ras-rest-api-guide/api-reference/infrastructure/agents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
