NavigationContentFooter
Jump toSuggest an edit

Migrating from Scaleway IoT Hub API v1beta1

Reviewed on 22 April 2024

Before you start

To complete the actions presented below, you must have:

  • Owner status or IAM permissions allowing you to perform actions in the intended Organization
Important

To ensure that users of the v1beta1 API have enough time to migrate, this version will remain online until November 30th 2021.

Here is a list of changes introduced by v1 of the IoT Hub API. Do not expect any major changes, this release is dedicated to cleaning up and improving the API to prepare for new features.

  • Scaleway Projects: This API version fully supports the new Project system. This means that from now on, IoT Hubs do not belong to an Organization but to a Project. To create an IoT Hub in a project, the Project ID must be passed in the project_id field.

Note: The ID of the default project is the same as the Organization ID

  • Cleanup: As Hubs are the main resource, and routes, devices and networks are attached to a Hub, Organization/Project IDs are no longer returned for resources that are not Hubs.
  • Metrics format: The metrics format has slightly changed.
  • Device creation: The returned device certificate and key are now embedded in a JSON object named certificate. See Device creation for a detailed explanation.
  • Device names: The device names are now unique (inside a hub) and read only. If you need to add a description to a device, you can do so via the newly-added field description.

Metrics format change

The v1beta1 metrics endpoints would follow this format:

{
"metrics": [
{
"name": "<metric name>",
"values": [
{
"time": "<timestamp>",
"value": 1
}
]
}
]
}

To have a consistent experience across Scaleway products, a common metrics format has been adopted. The changes are:

  • "values" were renamed to "points".
  • "time" has been renamed to "timestamp".
  • "points"’s "value" is now a float number instead of an integer.
{
"metrics": [
{
"name": "<metric name>",
"points": [
{
"timestamp": "<timestamp>",
"value": 2.0
}
]
}
]
}

Device creation

When creating a device, the v1beta1 used to return the device certificate and key at the root of the response object:

{
"device_id": "<device id>",
"crt": "<cert>",
"key": "<key>"
}

To have a consistent experience with device certificates, the certificates are now embedded in a certificate object.

{
"device_id": "<device id>",
"certificate": {
"crt": "<cert>",
"key": "<key>"
}
}
Important

The certificate object will be removed from the response if the Hub is using a custom Certificate Authority, as we do not possess the keys of such a CA.

Docs APIScaleway consoleDedibox consoleScaleway LearningScaleway.comPricingBlogCarreer
© 2023-2024 – Scaleway