Bosch IoT Device Management

Add a policy entry for public cloud connections

Prerequisites

You are empowered to change the specific policy.

Goal

Given you have a connection to a public cloud service such as described at Public cloud integration.

Request

Use the API docs of Bosch IoT Things

  • Authorize with a fresh Suite OAuth token.
    See Create a Suite Auth client

    images/confluence/download/attachments/1847337194/HTTP-API-Auth.png
  • Policies resource:

    • PUT/policies/{policyId}/entries/{label}

    • Click Try it out

    • Set the policyId to your.namespace:your-policy-name

      By default, the policy ID is exactly the same as the thing ID.


    • Set the label to "public-cloud-example"

    • Set the Request body

      {
      "subjects": {
      "integration:yourSolutionId:xxx": {
      "type": "public-cloud-example"
      }
      },
      "resources": {
      "thing:/": {
      "grant": [
      "READ",
      "WRITE"
      ],
      "revoke": [ ]
      },
      "message:/": {
      "grant": [
      "READ",
      "WRITE"
      ],
      "revoke": []
      }
      }
      }
    • Execute

Response

Upon success you get the status 201 "The Policy entry was successfully created."

Check your work

GET /policies/{policyId} and check of the new entry is there as you need it.

{
"policyId": "your.namespace:policy-01",
"entries": {
// "DEFAULT", "DEVICE", "DEVICE-MANAGEMENT"
// same as before
"public-cloud-example": {
"subjects": {
"integration:yourSolutionId:xxx": {
"type": "public-cloud-example"
}
},
"resources": {
"thing:/": {
"grant": [
"READ",
"WRITE"
],
"revoke": []
},
"message:/": {
"grant": [
"READ",
"WRITE"
],
"revoke": []
}
}
}
}
}