When an endpoint or server has been blocked in CloudRadial, either from the Block Endpoint button in the portal or through the API, it stops appearing in Infrastructure reports even though the agent is still checking in. If that device needs to come back, you can unblock it in the portal, or through the CloudRadial v2 API when you need to do it programmatically or in bulk.
The unblock itself runs through Swagger UI at https://api.us.cloudradial.com/swagger, which handles auth and request formatting for you.
- Before You Begin
- Authenticate in Swagger UI
- Find the Blocked Endpoint
- Unblock the Endpoint
- Response and Verification
- Troubleshooting
- Blocking an Endpoint
Before You Begin
You'll need:
- A CloudRadial API key pair (public and private key). If you don't already have one, generate a pair under Partner > Settings > Integrations > API (Beta) > +Add API Keys
- One of the following to identify the endpoint: its endpoint ID, its serial number, or its manufacturer and machine name
- Access to Swagger UI at https://api.us.cloudradial.com/swagger
Authenticate in Swagger UI
Click Authorize at the top of the Swagger UI page. Enter your public key as the username and your private key as the password. Swagger handles the Basic auth encoding and includes the header on every request for the rest of your session.
Find the Blocked Endpoint
If you don't already know which endpoints are blocked, the OData endpoint can list them. Swagger UI doesn't expose OData query options, so call this URL directly from a browser, curl, or PowerShell, using your key pair as Basic auth (public key as the username, private key as the password):
https://api.us.cloudradial.com/v2/odata/endpoint?$filter=isBlocked eq true&$select=companyEndpointId,name,companyId,serialNumber
Add and companyId eq {id} to the filter to scope it to a single company. Each record returned includes the companyEndpointId, which is the ID used in the next step.
Unblock the Endpoint
In Swagger UI, scroll to the Endpoint section and find PATCH /v2/endpoint/id/{endpointId}. Click Try it out, enter the endpoint ID, and paste the body below. PATCH uses the JSON Patch format (RFC 6902), so the body is an array of operations rather than a plain object. Click Execute.
[
{ "op": "replace", "path": "/isBlocked", "value": false }
]The same PATCH is also available at PATCH /v2/endpoint/{serialNumber} and PATCH /v2/endpoint/{manufacturer}/{machineName} if a different lookup key is more convenient.
Note: Use PATCH rather than PUT for this change. PUT replaces the entire endpoint record, and any field you leave out of the body is cleared.
Response and Verification
You'll get back HTTP 200 with a body of {"success": true, "message": "Endpoint successfully updated."}, which means the change was saved. To verify, re-run the OData query from the previous step; the endpoint should no longer be in the results. You can also check in the portal: Partner > Clients > [Client Name] > Impersonate Admin > Infrastructure > Endpoints. The device will appear in the list again, and its data refreshes on the agent's next check-in.
Every API response also includes an x-documentation-url header with a link to the request log. If something doesn't look right, that's the fastest way to find out what happened.
Troubleshooting
401 Unauthorized - the API key pair is wrong, inactive, or not formatted correctly for Basic auth.
404 Not Found - the endpoint ID, serial number, or manufacturer and machine name combination doesn't match an endpoint in your tenant.
400 Bad Request - the PATCH body isn't valid JSON Patch. Confirm the body is an array (wrapped in [ ]) and the path is /isBlocked.
200 but the endpoint still doesn't appear - the agent on that device may no longer be checking in. Blocking does not uninstall the agent, but if the device was removed, reimaged, or moved to another company, see Removing Endpoints and Servers.
Blocking an Endpoint
The same call blocks an endpoint when the value is true:
[
{ "op": "replace", "path": "/isBlocked", "value": true }
]This is equivalent to the Block Endpoint button in the portal. As with blocking from the portal, the agent is not uninstalled from the device.
If you are still having trouble, we're here to help! Submit a ticket here for assistance, and don't forget to check our status page to ensure there are no outages in your area.
Comments
0 comments
Article is closed for comments.