iot

package
v1.0.0-beta.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Overview

Package iot provides methods and message types of the iot v1 API.

Index

Constants

View Source
const (
	DeviceMessageFiltersRulePolicyUnknown = DeviceMessageFiltersRulePolicy("unknown")
	DeviceMessageFiltersRulePolicyAccept  = DeviceMessageFiltersRulePolicy("accept")
	DeviceMessageFiltersRulePolicyReject  = DeviceMessageFiltersRulePolicy("reject")
)
View Source
const (
	DeviceStatusUnknown  = DeviceStatus("unknown")
	DeviceStatusError    = DeviceStatus("error")
	DeviceStatusEnabled  = DeviceStatus("enabled")
	DeviceStatusDisabled = DeviceStatus("disabled")
)
View Source
const (
	HubProductPlanPlanUnknown   = HubProductPlan("plan_unknown")
	HubProductPlanPlanShared    = HubProductPlan("plan_shared")
	HubProductPlanPlanDedicated = HubProductPlan("plan_dedicated")
	HubProductPlanPlanHa        = HubProductPlan("plan_ha")
)
View Source
const (
	HubStatusUnknown   = HubStatus("unknown")
	HubStatusError     = HubStatus("error")
	HubStatusEnabling  = HubStatus("enabling")
	HubStatusReady     = HubStatus("ready")
	HubStatusDisabling = HubStatus("disabling")
	HubStatusDisabled  = HubStatus("disabled")
)
View Source
const (
	ListDevicesRequestOrderByNameAsc           = ListDevicesRequestOrderBy("name_asc")
	ListDevicesRequestOrderByNameDesc          = ListDevicesRequestOrderBy("name_desc")
	ListDevicesRequestOrderByStatusAsc         = ListDevicesRequestOrderBy("status_asc")
	ListDevicesRequestOrderByStatusDesc        = ListDevicesRequestOrderBy("status_desc")
	ListDevicesRequestOrderByHubIDAsc          = ListDevicesRequestOrderBy("hub_id_asc")
	ListDevicesRequestOrderByHubIDDesc         = ListDevicesRequestOrderBy("hub_id_desc")
	ListDevicesRequestOrderByCreatedAtAsc      = ListDevicesRequestOrderBy("created_at_asc")
	ListDevicesRequestOrderByCreatedAtDesc     = ListDevicesRequestOrderBy("created_at_desc")
	ListDevicesRequestOrderByUpdatedAtAsc      = ListDevicesRequestOrderBy("updated_at_asc")
	ListDevicesRequestOrderByUpdatedAtDesc     = ListDevicesRequestOrderBy("updated_at_desc")
	ListDevicesRequestOrderByAllowInsecureAsc  = ListDevicesRequestOrderBy("allow_insecure_asc")
	ListDevicesRequestOrderByAllowInsecureDesc = ListDevicesRequestOrderBy("allow_insecure_desc")
)
View Source
const (
	ListHubsRequestOrderByNameAsc         = ListHubsRequestOrderBy("name_asc")
	ListHubsRequestOrderByNameDesc        = ListHubsRequestOrderBy("name_desc")
	ListHubsRequestOrderByStatusAsc       = ListHubsRequestOrderBy("status_asc")
	ListHubsRequestOrderByStatusDesc      = ListHubsRequestOrderBy("status_desc")
	ListHubsRequestOrderByProductPlanAsc  = ListHubsRequestOrderBy("product_plan_asc")
	ListHubsRequestOrderByProductPlanDesc = ListHubsRequestOrderBy("product_plan_desc")
	ListHubsRequestOrderByCreatedAtAsc    = ListHubsRequestOrderBy("created_at_asc")
	ListHubsRequestOrderByCreatedAtDesc   = ListHubsRequestOrderBy("created_at_desc")
	ListHubsRequestOrderByUpdatedAtAsc    = ListHubsRequestOrderBy("updated_at_asc")
	ListHubsRequestOrderByUpdatedAtDesc   = ListHubsRequestOrderBy("updated_at_desc")
)
View Source
const (
	ListNetworksRequestOrderByNameAsc       = ListNetworksRequestOrderBy("name_asc")
	ListNetworksRequestOrderByNameDesc      = ListNetworksRequestOrderBy("name_desc")
	ListNetworksRequestOrderByTypeAsc       = ListNetworksRequestOrderBy("type_asc")
	ListNetworksRequestOrderByTypeDesc      = ListNetworksRequestOrderBy("type_desc")
	ListNetworksRequestOrderByCreatedAtAsc  = ListNetworksRequestOrderBy("created_at_asc")
	ListNetworksRequestOrderByCreatedAtDesc = ListNetworksRequestOrderBy("created_at_desc")
)
View Source
const (
	ListRoutesRequestOrderByNameAsc       = ListRoutesRequestOrderBy("name_asc")
	ListRoutesRequestOrderByNameDesc      = ListRoutesRequestOrderBy("name_desc")
	ListRoutesRequestOrderByHubIDAsc      = ListRoutesRequestOrderBy("hub_id_asc")
	ListRoutesRequestOrderByHubIDDesc     = ListRoutesRequestOrderBy("hub_id_desc")
	ListRoutesRequestOrderByTypeAsc       = ListRoutesRequestOrderBy("type_asc")
	ListRoutesRequestOrderByTypeDesc      = ListRoutesRequestOrderBy("type_desc")
	ListRoutesRequestOrderByCreatedAtAsc  = ListRoutesRequestOrderBy("created_at_asc")
	ListRoutesRequestOrderByCreatedAtDesc = ListRoutesRequestOrderBy("created_at_desc")
)
View Source
const (
	NetworkNetworkTypeUnknown = NetworkNetworkType("unknown")
	NetworkNetworkTypeSigfox  = NetworkNetworkType("sigfox")
	NetworkNetworkTypeRest    = NetworkNetworkType("rest")
)
View Source
const (
	RouteDatabaseConfigEngineUnknown    = RouteDatabaseConfigEngine("unknown")
	RouteDatabaseConfigEnginePostgresql = RouteDatabaseConfigEngine("postgresql")
	RouteDatabaseConfigEngineMysql      = RouteDatabaseConfigEngine("mysql")
)
View Source
const (
	RouteRestConfigHTTPVerbUnknown = RouteRestConfigHTTPVerb("unknown")
	RouteRestConfigHTTPVerbGet     = RouteRestConfigHTTPVerb("get")
	RouteRestConfigHTTPVerbPost    = RouteRestConfigHTTPVerb("post")
	RouteRestConfigHTTPVerbPut     = RouteRestConfigHTTPVerb("put")
	RouteRestConfigHTTPVerbPatch   = RouteRestConfigHTTPVerb("patch")
	RouteRestConfigHTTPVerbDelete  = RouteRestConfigHTTPVerb("delete")
)
View Source
const (
	RouteRouteTypeUnknown  = RouteRouteType("unknown")
	RouteRouteTypeS3       = RouteRouteType("s3")
	RouteRouteTypeDatabase = RouteRouteType("database")
	RouteRouteTypeRest     = RouteRouteType("rest")
)
View Source
const (
	RouteS3ConfigS3StrategyUnknown    = RouteS3ConfigS3Strategy("unknown")
	RouteS3ConfigS3StrategyPerTopic   = RouteS3ConfigS3Strategy("per_topic")
	RouteS3ConfigS3StrategyPerMessage = RouteS3ConfigS3Strategy("per_message")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

This API allows you to manage IoT hubs and devices.

func NewAPI

func NewAPI(client *scw.Client) *API

NewAPI returns a API object from a Scaleway client.

func (*API) CreateDevice

func (s *API) CreateDevice(req *CreateDeviceRequest, opts ...scw.RequestOption) (*CreateDeviceResponse, error)

CreateDevice: Attach a device to a given Hub.

func (*API) CreateHub

func (s *API) CreateHub(req *CreateHubRequest, opts ...scw.RequestOption) (*Hub, error)

CreateHub: Create a new Hub in the targeted region, specifying its configuration including name and product plan.

func (*API) CreateNetwork

func (s *API) CreateNetwork(req *CreateNetworkRequest, opts ...scw.RequestOption) (*CreateNetworkResponse, error)

CreateNetwork: Create a new network for an existing hub. Beside the default network, you can add networks for different data providers. Possible network types are Sigfox and REST.

func (*API) CreateRoute

func (s *API) CreateRoute(req *CreateRouteRequest, opts ...scw.RequestOption) (*Route, error)

CreateRoute: Multiple kinds of routes can be created, such as:

  • Database Route Create a route that will record subscribed MQTT messages into your database. <b>You need to manage the database by yourself</b>.
  • REST Route. Create a route that will call a REST API on received subscribed MQTT messages.
  • S3 Routes. Create a route that will put subscribed MQTT messages into an S3 bucket. You need to create the bucket yourself and grant write access. Granting can be done with s3cmd (`s3cmd setacl s3://<my-bucket> --acl-grant=write:555c69c3-87d0-4bf8-80f1-99a2f757d031:555c69c3-87d0-4bf8-80f1-99a2f757d031`).

func (*API) DeleteDevice

func (s *API) DeleteDevice(req *DeleteDeviceRequest, opts ...scw.RequestOption) error

DeleteDevice: Remove a specific device from the specific Hub it is attached to.

func (*API) DeleteHub

func (s *API) DeleteHub(req *DeleteHubRequest, opts ...scw.RequestOption) error

DeleteHub: Delete an existing IoT Hub, specified by its Hub ID. Deleting a Hub is permanent, and cannot be undone.

func (*API) DeleteNetwork

func (s *API) DeleteNetwork(req *DeleteNetworkRequest, opts ...scw.RequestOption) error

DeleteNetwork: Delete an existing network, specified by its network ID. Deleting a network is permanent, and cannot be undone.

func (*API) DeleteRoute

func (s *API) DeleteRoute(req *DeleteRouteRequest, opts ...scw.RequestOption) error

DeleteRoute: Delete an existing route, specified by its route ID. Deleting a route is permanent, and cannot be undone.

func (*API) DeleteTwinDocument

func (s *API) DeleteTwinDocument(req *DeleteTwinDocumentRequest, opts ...scw.RequestOption) error

DeleteTwinDocument: BETA - Delete a Cloud Twin Document.

func (*API) DeleteTwinDocuments

func (s *API) DeleteTwinDocuments(req *DeleteTwinDocumentsRequest, opts ...scw.RequestOption) error

DeleteTwinDocuments: BETA - Delete all the documents of a Cloud Twin.

func (*API) DisableDevice

func (s *API) DisableDevice(req *DisableDeviceRequest, opts ...scw.RequestOption) (*Device, error)

DisableDevice: Disable an existing device, specified by its device ID.

func (*API) DisableHub

func (s *API) DisableHub(req *DisableHubRequest, opts ...scw.RequestOption) (*Hub, error)

DisableHub: Disable an existing IoT Hub, specified by its Hub ID.

func (*API) EnableDevice

func (s *API) EnableDevice(req *EnableDeviceRequest, opts ...scw.RequestOption) (*Device, error)

EnableDevice: Enable a specific device, specified by its device ID.

func (*API) EnableHub

func (s *API) EnableHub(req *EnableHubRequest, opts ...scw.RequestOption) (*Hub, error)

EnableHub: Enable an existing IoT Hub, specified by its Hub ID.

func (*API) GetDevice

func (s *API) GetDevice(req *GetDeviceRequest, opts ...scw.RequestOption) (*Device, error)

GetDevice: Retrieve information about an existing device, specified by its device ID. Its full details, including name, status and ID, are returned in the response object.

func (*API) GetDeviceCertificate

func (s *API) GetDeviceCertificate(req *GetDeviceCertificateRequest, opts ...scw.RequestOption) (*GetDeviceCertificateResponse, error)

GetDeviceCertificate: Get information for a particular PEM-encoded certificate, specified by the device ID. The response returns full details of the device, including its type of certificate.

func (*API) GetDeviceMetrics deprecated

func (s *API) GetDeviceMetrics(req *GetDeviceMetricsRequest, opts ...scw.RequestOption) (*GetDeviceMetricsResponse, error)

Deprecated: GetDeviceMetrics: Get the metrics of an existing device, specified by its device ID.

func (*API) GetHub

func (s *API) GetHub(req *GetHubRequest, opts ...scw.RequestOption) (*Hub, error)

GetHub: Retrieve information about an existing IoT Hub, specified by its Hub ID. Its full details, including name, status and endpoint, are returned in the response object.

func (*API) GetHubCA

func (s *API) GetHubCA(req *GetHubCARequest, opts ...scw.RequestOption) (*GetHubCAResponse, error)

GetHubCA: Get information for a particular PEM-encoded certificate, specified by the Hub ID.

func (*API) GetHubMetrics deprecated

func (s *API) GetHubMetrics(req *GetHubMetricsRequest, opts ...scw.RequestOption) (*GetHubMetricsResponse, error)

Deprecated: GetHubMetrics: Get the metrics of an existing IoT Hub, specified by its Hub ID.

func (*API) GetNetwork

func (s *API) GetNetwork(req *GetNetworkRequest, opts ...scw.RequestOption) (*Network, error)

GetNetwork: Retrieve an existing network, specified by its network ID. The response returns full details of the network, including its type, the topic prefix and its endpoint.

func (*API) GetRoute

func (s *API) GetRoute(req *GetRouteRequest, opts ...scw.RequestOption) (*Route, error)

GetRoute: Get information for a particular route, specified by the route ID. The response returns full details of the route, including its type, the topic it subscribes to and its configuration.

func (*API) GetTwinDocument

func (s *API) GetTwinDocument(req *GetTwinDocumentRequest, opts ...scw.RequestOption) (*TwinDocument, error)

GetTwinDocument: BETA - Get a Cloud Twin Document.

func (*API) ListDevices

func (s *API) ListDevices(req *ListDevicesRequest, opts ...scw.RequestOption) (*ListDevicesResponse, error)

ListDevices: List all devices in the specified region. By default, returned devices are ordered by creation date in ascending order, though this can be modified via the `order_by` field.

func (*API) ListHubs

func (s *API) ListHubs(req *ListHubsRequest, opts ...scw.RequestOption) (*ListHubsResponse, error)

ListHubs: List all Hubs in the specified zone. By default, returned Hubs are ordered by creation date in ascending order, though this can be modified via the `order_by` field.

func (*API) ListNetworks

func (s *API) ListNetworks(req *ListNetworksRequest, opts ...scw.RequestOption) (*ListNetworksResponse, error)

ListNetworks: List the networks.

func (*API) ListRoutes

func (s *API) ListRoutes(req *ListRoutesRequest, opts ...scw.RequestOption) (*ListRoutesResponse, error)

ListRoutes: List all routes in the specified region. By default, returned routes are ordered by creation date in ascending order, though this can be modified via the `order_by` field.

func (*API) ListTwinDocuments

func (s *API) ListTwinDocuments(req *ListTwinDocumentsRequest, opts ...scw.RequestOption) (*ListTwinDocumentsResponse, error)

ListTwinDocuments: BETA - List the documents of a Cloud Twin.

func (*API) PatchTwinDocument

func (s *API) PatchTwinDocument(req *PatchTwinDocumentRequest, opts ...scw.RequestOption) (*TwinDocument, error)

PatchTwinDocument: BETA - Patch a Cloud Twin Document.

func (*API) PutTwinDocument

func (s *API) PutTwinDocument(req *PutTwinDocumentRequest, opts ...scw.RequestOption) (*TwinDocument, error)

PutTwinDocument: BETA - Update a Cloud Twin Document.

func (*API) Regions

func (s *API) Regions() []scw.Region

func (*API) RenewDeviceCertificate

func (s *API) RenewDeviceCertificate(req *RenewDeviceCertificateRequest, opts ...scw.RequestOption) (*RenewDeviceCertificateResponse, error)

RenewDeviceCertificate: Renew the certificate of an existing device, specified by its device ID.

func (*API) SetDeviceCertificate

func (s *API) SetDeviceCertificate(req *SetDeviceCertificateRequest, opts ...scw.RequestOption) (*SetDeviceCertificateResponse, error)

SetDeviceCertificate: Switch the existing certificate of a given device with an EM-encoded custom certificate.

func (*API) SetHubCA

func (s *API) SetHubCA(req *SetHubCARequest, opts ...scw.RequestOption) (*Hub, error)

SetHubCA: Set a particular PEM-encoded certificate, specified by the Hub ID.

func (*API) UpdateDevice

func (s *API) UpdateDevice(req *UpdateDeviceRequest, opts ...scw.RequestOption) (*Device, error)

UpdateDevice: Update the parameters of an existing device, specified by its device ID.

func (*API) UpdateHub

func (s *API) UpdateHub(req *UpdateHubRequest, opts ...scw.RequestOption) (*Hub, error)

UpdateHub: Update the parameters of an existing IoT Hub, specified by its Hub ID.

func (*API) UpdateRoute

func (s *API) UpdateRoute(req *UpdateRouteRequest, opts ...scw.RequestOption) (*Route, error)

UpdateRoute: Update the parameters of an existing route, specified by its route ID.

func (*API) WaitForHub

func (s *API) WaitForHub(req *WaitForHubRequest, opts ...scw.RequestOption) (*Hub, error)

WaitForHub waits for the hub to be in a ready state before returning.

type Certificate

type Certificate struct {
	Crt string `json:"crt"`

	Key string `json:"key"`
}

Certificate: certificate.

type CreateDeviceRequest

type CreateDeviceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Name: device name.
	Name string `json:"name"`

	// HubID: hub ID of the device.
	HubID string `json:"hub_id"`

	// AllowInsecure: defines whether to allow plain and server-authenticated SSL connections in addition to mutually-authenticated ones.
	AllowInsecure bool `json:"allow_insecure"`

	// AllowMultipleConnections: defines whether to allow multiple physical devices to connect with this device's credentials.
	AllowMultipleConnections bool `json:"allow_multiple_connections"`

	// MessageFilters: filter-sets to authorize or deny the device to publish/subscribe to specific topics.
	MessageFilters *DeviceMessageFilters `json:"message_filters,omitempty"`

	// Description: device description.
	Description *string `json:"description,omitempty"`
}

CreateDeviceRequest: create device request.

type CreateDeviceResponse

type CreateDeviceResponse struct {
	// Device: information related to the created device.
	Device *Device `json:"device"`

	// Certificate: device certificate.
	Certificate *Certificate `json:"certificate"`
}

CreateDeviceResponse: create device response.

type CreateHubRequest

type CreateHubRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Name: hub name (up to 255 characters).
	Name string `json:"name"`

	// ProjectID: project/Organization ID to filter for, only Hubs from this Project/Organization will be returned.
	ProjectID string `json:"project_id"`

	// ProductPlan: hub product plan.
	// Default value: plan_unknown
	ProductPlan HubProductPlan `json:"product_plan"`

	// DisableEvents: disable Hub events.
	DisableEvents *bool `json:"disable_events,omitempty"`

	// EventsTopicPrefix: topic prefix (default '$SCW/events') of Hub events.
	EventsTopicPrefix *string `json:"events_topic_prefix,omitempty"`

	// TwinsGraphiteConfig: bETA - not implemented yet.
	// Precisely one of TwinsGraphiteConfig must be set.
	TwinsGraphiteConfig *HubTwinsGraphiteConfig `json:"twins_graphite_config,omitempty"`
}

CreateHubRequest: create hub request.

type CreateNetworkRequest

type CreateNetworkRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Name: network name.
	Name string `json:"name"`

	// Type: type of network to connect with.
	// Default value: unknown
	Type NetworkNetworkType `json:"type"`

	// HubID: hub ID to connect the Network to.
	HubID string `json:"hub_id"`

	// TopicPrefix: topic prefix for the Network.
	TopicPrefix string `json:"topic_prefix"`
}

CreateNetworkRequest: create network request.

type CreateNetworkResponse

type CreateNetworkResponse struct {
	// Network: information related to the created network.
	Network *Network `json:"network"`

	// Secret: endpoint Key to keep secret. This cannot be retrieved later.
	Secret string `json:"secret"`
}

CreateNetworkResponse: create network response.

type CreateRouteRequest

type CreateRouteRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Name: route name.
	Name string `json:"name"`

	// HubID: hub ID of the route.
	HubID string `json:"hub_id"`

	// Topic: topic the route subscribes to. It must be a valid MQTT topic and up to 65535 characters.
	Topic string `json:"topic"`

	// S3Config: if creating S3 Route, S3-specific configuration fields.
	// Precisely one of S3Config, DbConfig, RestConfig must be set.
	S3Config *CreateRouteRequestS3Config `json:"s3_config,omitempty"`

	// DbConfig: if creating Database Route, DB-specific configuration fields.
	// Precisely one of S3Config, DbConfig, RestConfig must be set.
	DbConfig *CreateRouteRequestDatabaseConfig `json:"db_config,omitempty"`

	// RestConfig: if creating Rest Route, Rest-specific configuration fields.
	// Precisely one of S3Config, DbConfig, RestConfig must be set.
	RestConfig *CreateRouteRequestRestConfig `json:"rest_config,omitempty"`
}

CreateRouteRequest: create route request.

type CreateRouteRequestDatabaseConfig

type CreateRouteRequestDatabaseConfig struct {
	Host string `json:"host"`

	Port uint32 `json:"port"`

	Dbname string `json:"dbname"`

	Username string `json:"username"`

	Password string `json:"password"`

	Query string `json:"query"`

	// Engine: default value: unknown
	Engine RouteDatabaseConfigEngine `json:"engine"`
}

CreateRouteRequestDatabaseConfig: create route request database config.

type CreateRouteRequestRestConfig

type CreateRouteRequestRestConfig struct {
	// Verb: default value: unknown
	Verb RouteRestConfigHTTPVerb `json:"verb"`

	URI string `json:"uri"`

	Headers map[string]string `json:"headers"`
}

CreateRouteRequestRestConfig: create route request rest config.

type CreateRouteRequestS3Config

type CreateRouteRequestS3Config struct {
	BucketRegion string `json:"bucket_region"`

	BucketName string `json:"bucket_name"`

	ObjectPrefix string `json:"object_prefix"`

	// Strategy: default value: unknown
	Strategy RouteS3ConfigS3Strategy `json:"strategy"`
}

CreateRouteRequestS3Config: create route request s3 config.

type DeleteDeviceRequest

type DeleteDeviceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// DeviceID: device ID.
	DeviceID string `json:"-"`
}

DeleteDeviceRequest: delete device request.

type DeleteHubRequest

type DeleteHubRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// HubID: hub ID.
	HubID string `json:"-"`

	// DeleteDevices: defines whether to force the deletion of devices added to this Hub or reject the operation.
	DeleteDevices *bool `json:"delete_devices,omitempty"`
}

DeleteHubRequest: delete hub request.

type DeleteNetworkRequest

type DeleteNetworkRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// NetworkID: network ID.
	NetworkID string `json:"-"`
}

DeleteNetworkRequest: delete network request.

type DeleteRouteRequest

type DeleteRouteRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// RouteID: route ID.
	RouteID string `json:"-"`
}

DeleteRouteRequest: delete route request.

type DeleteTwinDocumentRequest

type DeleteTwinDocumentRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// TwinID: twin ID.
	TwinID string `json:"-"`

	// DocumentName: name of the document.
	DocumentName string `json:"-"`
}

DeleteTwinDocumentRequest: delete twin document request.

type DeleteTwinDocumentsRequest

type DeleteTwinDocumentsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// TwinID: twin ID.
	TwinID string `json:"-"`
}

DeleteTwinDocumentsRequest: delete twin documents request.

type Device

type Device struct {
	// ID: device ID, also used as MQTT Client ID or username.
	ID string `json:"id"`

	// Name: device name.
	Name string `json:"name"`

	// Description: device description.
	Description string `json:"description"`

	// Status: device status.
	// Default value: unknown
	Status DeviceStatus `json:"status"`

	// HubID: hub ID.
	HubID string `json:"hub_id"`

	// LastActivityAt: last connection/activity date of a device.
	LastActivityAt *time.Time `json:"last_activity_at"`

	// IsConnected: defines whether the device is connected to the Hub.
	IsConnected bool `json:"is_connected"`

	// AllowInsecure: defines whether to allow the device to connect to the Hub without TLS mutual authentication.
	AllowInsecure bool `json:"allow_insecure"`

	// AllowMultipleConnections: defines whether to allow multiple physical devices to connect to the Hub with this device's credentials.
	AllowMultipleConnections bool `json:"allow_multiple_connections"`

	// MessageFilters: filter-sets to restrict the topics the device can publish/subscribe to.
	MessageFilters *DeviceMessageFilters `json:"message_filters"`

	// HasCustomCertificate: assigning a custom certificate allows a device to authenticate using that specific certificate without checking the Hub's CA certificate.
	HasCustomCertificate bool `json:"has_custom_certificate"`

	// CreatedAt: date at which the device was added.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: date at which the device was last modified.
	UpdatedAt *time.Time `json:"updated_at"`
}

Device: device.

type DeviceMessageFilters

type DeviceMessageFilters struct {
	// Publish: filtering rule to restrict topics the device can publish to.
	Publish *DeviceMessageFiltersRule `json:"publish"`

	// Subscribe: filtering rule to restrict topics the device can subscribe to.
	Subscribe *DeviceMessageFiltersRule `json:"subscribe"`
}

DeviceMessageFilters: device message filters.

type DeviceMessageFiltersRule

type DeviceMessageFiltersRule struct {
	// Policy: if set to `accept`, all topics in the topics list will be allowed, with all other topics being denied.
	// If set to `reject`, all topics in the topics list will be denied, with all other topics being allowed.
	// Default value: unknown
	Policy DeviceMessageFiltersRulePolicy `json:"policy"`

	// Topics: list of topics to accept or reject. It must be valid MQTT topics and up to 65535 characters.
	Topics *[]string `json:"topics"`
}

DeviceMessageFiltersRule: device message filters rule.

type DeviceMessageFiltersRulePolicy

type DeviceMessageFiltersRulePolicy string

func (DeviceMessageFiltersRulePolicy) MarshalJSON

func (enum DeviceMessageFiltersRulePolicy) MarshalJSON() ([]byte, error)

func (DeviceMessageFiltersRulePolicy) String

func (enum DeviceMessageFiltersRulePolicy) String() string

func (*DeviceMessageFiltersRulePolicy) UnmarshalJSON

func (enum *DeviceMessageFiltersRulePolicy) UnmarshalJSON(data []byte) error

type DeviceStatus

type DeviceStatus string

func (DeviceStatus) MarshalJSON

func (enum DeviceStatus) MarshalJSON() ([]byte, error)

func (DeviceStatus) String

func (enum DeviceStatus) String() string

func (*DeviceStatus) UnmarshalJSON

func (enum *DeviceStatus) UnmarshalJSON(data []byte) error

type DisableDeviceRequest

type DisableDeviceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// DeviceID: device ID.
	DeviceID string `json:"-"`
}

DisableDeviceRequest: disable device request.

type DisableHubRequest

type DisableHubRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// HubID: hub ID.
	HubID string `json:"-"`
}

DisableHubRequest: disable hub request.

type EnableDeviceRequest

type EnableDeviceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// DeviceID: device ID.
	DeviceID string `json:"-"`
}

EnableDeviceRequest: enable device request.

type EnableHubRequest

type EnableHubRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// HubID: hub ID.
	HubID string `json:"-"`
}

EnableHubRequest: enable hub request.

type GetDeviceCertificateRequest

type GetDeviceCertificateRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// DeviceID: device ID.
	DeviceID string `json:"-"`
}

GetDeviceCertificateRequest: get device certificate request.

type GetDeviceCertificateResponse

type GetDeviceCertificateResponse struct {
	// Device: information related to the created device.
	Device *Device `json:"device"`

	// CertificatePem: device certificate.
	CertificatePem string `json:"certificate_pem"`
}

GetDeviceCertificateResponse: get device certificate response.

type GetDeviceMetricsRequest

type GetDeviceMetricsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// DeviceID: device ID.
	DeviceID string `json:"-"`

	// StartDate: start date used to compute the best scale for the returned metrics.
	StartDate *time.Time `json:"start_date,omitempty"`
}

GetDeviceMetricsRequest: get device metrics request.

type GetDeviceMetricsResponse

type GetDeviceMetricsResponse struct {
	// Metrics: metrics for a device over the requested period.
	Metrics []*scw.TimeSeries `json:"metrics"`
}

GetDeviceMetricsResponse: get device metrics response.

type GetDeviceRequest

type GetDeviceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// DeviceID: device ID.
	DeviceID string `json:"-"`
}

GetDeviceRequest: get device request.

type GetHubCARequest

type GetHubCARequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	HubID string `json:"-"`
}

GetHubCARequest: get hub ca request.

type GetHubCAResponse

type GetHubCAResponse struct {
	CaCertPem string `json:"ca_cert_pem"`
}

GetHubCAResponse: get hub ca response.

type GetHubMetricsRequest

type GetHubMetricsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// HubID: hub ID.
	HubID string `json:"-"`

	// StartDate: start date used to compute the best scale for returned metrics.
	StartDate *time.Time `json:"start_date,omitempty"`
}

GetHubMetricsRequest: get hub metrics request.

type GetHubMetricsResponse

type GetHubMetricsResponse struct {
	// Metrics: metrics for a Hub over the requested period.
	Metrics []*scw.TimeSeries `json:"metrics"`
}

GetHubMetricsResponse: get hub metrics response.

type GetHubRequest

type GetHubRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// HubID: hub ID.
	HubID string `json:"-"`
}

GetHubRequest: get hub request.

type GetNetworkRequest

type GetNetworkRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// NetworkID: network ID.
	NetworkID string `json:"-"`
}

GetNetworkRequest: get network request.

type GetRouteRequest

type GetRouteRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// RouteID: route ID.
	RouteID string `json:"-"`
}

GetRouteRequest: get route request.

type GetTwinDocumentRequest

type GetTwinDocumentRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// TwinID: twin ID.
	TwinID string `json:"-"`

	// DocumentName: name of the document.
	DocumentName string `json:"-"`
}

GetTwinDocumentRequest: get twin document request.

type Hub

type Hub struct {
	// ID: hub ID.
	ID string `json:"id"`

	// Name: hub name.
	Name string `json:"name"`

	// Status: current status of the Hub.
	// Default value: unknown
	Status HubStatus `json:"status"`

	// ProductPlan: hub feature set.
	// Default value: plan_unknown
	ProductPlan HubProductPlan `json:"product_plan"`

	// Enabled: defines whether the hub has been enabled.
	Enabled bool `json:"enabled"`

	// DeviceCount: number of registered devices.
	DeviceCount uint64 `json:"device_count"`

	// ConnectedDeviceCount: number of currently connected devices.
	ConnectedDeviceCount uint64 `json:"connected_device_count"`

	// Endpoint: devices should be connected to this host. Port may be 1883 (MQTT), 8883 (MQTT over TLS), 80 (MQTT over Websocket) or 443 (MQTT over Websocket over TLS).
	Endpoint string `json:"endpoint"`

	// DisableEvents: defines whether to disable Hub events.
	DisableEvents bool `json:"disable_events"`

	// EventsTopicPrefix: hub events topic prefix.
	EventsTopicPrefix string `json:"events_topic_prefix"`

	// Region: region of the Hub.
	Region scw.Region `json:"region"`

	// CreatedAt: hub creation date.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: hub last modification date.
	UpdatedAt *time.Time `json:"updated_at"`

	// ProjectID: project owning the resource.
	ProjectID string `json:"project_id"`

	// OrganizationID: organization owning the resource.
	OrganizationID string `json:"organization_id"`

	// EnableDeviceAutoProvisioning: when an unknown device connects to your hub using a valid certificate chain, it will be automatically provisioned inside your Hub. The Hub uses the common name of the device certifcate to find out if a device with the same name already exists. This setting can only be enabled on a hub with a custom certificate authority.
	EnableDeviceAutoProvisioning bool `json:"enable_device_auto_provisioning"`

	// HasCustomCa: flag is automatically set to `false` after Hub creation, as Hub certificates are managed by Scaleway. Once a custom certificate authority is set, the flag will be set to `true`.
	HasCustomCa bool `json:"has_custom_ca"`

	// TwinsGraphiteConfig: bETA - not implemented yet.
	// Precisely one of TwinsGraphiteConfig must be set.
	TwinsGraphiteConfig *HubTwinsGraphiteConfig `json:"twins_graphite_config,omitempty"`
}

Hub: hub.

type HubProductPlan

type HubProductPlan string

func (HubProductPlan) MarshalJSON

func (enum HubProductPlan) MarshalJSON() ([]byte, error)

func (HubProductPlan) String

func (enum HubProductPlan) String() string

func (*HubProductPlan) UnmarshalJSON

func (enum *HubProductPlan) UnmarshalJSON(data []byte) error

type HubStatus

type HubStatus string

func (HubStatus) MarshalJSON

func (enum HubStatus) MarshalJSON() ([]byte, error)

func (HubStatus) String

func (enum HubStatus) String() string

func (*HubStatus) UnmarshalJSON

func (enum *HubStatus) UnmarshalJSON(data []byte) error

type HubTwinsGraphiteConfig

type HubTwinsGraphiteConfig struct {
	PushURI string `json:"push_uri"`
}

HubTwinsGraphiteConfig: hub twins graphite config.

type ListDevicesRequest

type ListDevicesRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Page: page number to return, from the paginated results.
	Page *int32 `json:"-"`

	// PageSize: number of devices to return within a page. Maximum value is 100.
	PageSize *uint32 `json:"-"`

	// OrderBy: ordering of requested devices.
	// Default value: name_asc
	OrderBy ListDevicesRequestOrderBy `json:"-"`

	// Name: name to filter for, only devices with this name will be returned.
	Name *string `json:"-"`

	// HubID: hub ID to filter for, only devices attached to this Hub will be returned.
	HubID *string `json:"-"`

	// AllowInsecure: defines wheter to filter the allow_insecure flag.
	AllowInsecure *bool `json:"-"`

	// Status: device status (enabled, disabled, etc.).
	// Default value: unknown
	Status DeviceStatus `json:"-"`
}

ListDevicesRequest: list devices request.

type ListDevicesRequestOrderBy

type ListDevicesRequestOrderBy string

func (ListDevicesRequestOrderBy) MarshalJSON

func (enum ListDevicesRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListDevicesRequestOrderBy) String

func (enum ListDevicesRequestOrderBy) String() string

func (*ListDevicesRequestOrderBy) UnmarshalJSON

func (enum *ListDevicesRequestOrderBy) UnmarshalJSON(data []byte) error

type ListDevicesResponse

type ListDevicesResponse struct {
	// TotalCount: total number of devices.
	TotalCount uint32 `json:"total_count"`

	// Devices: page of devices.
	Devices []*Device `json:"devices"`
}

ListDevicesResponse: list devices response.

func (*ListDevicesResponse) UnsafeAppend

func (r *ListDevicesResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListDevicesResponse) UnsafeGetTotalCount

func (r *ListDevicesResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListHubsRequest

type ListHubsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Page: page number to return, from the paginated results.
	Page *int32 `json:"-"`

	// PageSize: number of Hubs to return within a page. Maximum value is 100.
	PageSize *uint32 `json:"-"`

	// OrderBy: sort order of Hubs in the response.
	// Default value: name_asc
	OrderBy ListHubsRequestOrderBy `json:"-"`

	// ProjectID: only list Hubs of this Project ID.
	ProjectID *string `json:"-"`

	// OrganizationID: only list Hubs of this Organization ID.
	OrganizationID *string `json:"-"`

	// Name: hub name.
	Name *string `json:"-"`
}

ListHubsRequest: list hubs request.

type ListHubsRequestOrderBy

type ListHubsRequestOrderBy string

func (ListHubsRequestOrderBy) MarshalJSON

func (enum ListHubsRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListHubsRequestOrderBy) String

func (enum ListHubsRequestOrderBy) String() string

func (*ListHubsRequestOrderBy) UnmarshalJSON

func (enum *ListHubsRequestOrderBy) UnmarshalJSON(data []byte) error

type ListHubsResponse

type ListHubsResponse struct {
	// TotalCount: total number of Hubs.
	TotalCount uint32 `json:"total_count"`

	// Hubs: a page of hubs.
	Hubs []*Hub `json:"hubs"`
}

ListHubsResponse: list hubs response.

func (*ListHubsResponse) UnsafeAppend

func (r *ListHubsResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListHubsResponse) UnsafeGetTotalCount

func (r *ListHubsResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListNetworksRequest

type ListNetworksRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Page: page number to return, from the paginated results.
	Page *int32 `json:"-"`

	// PageSize: number of networks to return. The maximum value is 100.
	PageSize *uint32 `json:"-"`

	// OrderBy: ordering of requested routes.
	// Default value: name_asc
	OrderBy ListNetworksRequestOrderBy `json:"-"`

	// Name: network name to filter for.
	Name *string `json:"-"`

	// HubID: hub ID to filter for.
	HubID *string `json:"-"`

	// TopicPrefix: topic prefix to filter for.
	TopicPrefix *string `json:"-"`
}

ListNetworksRequest: list networks request.

type ListNetworksRequestOrderBy

type ListNetworksRequestOrderBy string

func (ListNetworksRequestOrderBy) MarshalJSON

func (enum ListNetworksRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListNetworksRequestOrderBy) String

func (enum ListNetworksRequestOrderBy) String() string

func (*ListNetworksRequestOrderBy) UnmarshalJSON

func (enum *ListNetworksRequestOrderBy) UnmarshalJSON(data []byte) error

type ListNetworksResponse

type ListNetworksResponse struct {
	// TotalCount: total number of Networks.
	TotalCount uint32 `json:"total_count"`

	// Networks: page of networks.
	Networks []*Network `json:"networks"`
}

ListNetworksResponse: list networks response.

func (*ListNetworksResponse) UnsafeAppend

func (r *ListNetworksResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListNetworksResponse) UnsafeGetTotalCount

func (r *ListNetworksResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListRoutesRequest

type ListRoutesRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// Page: page number to return, from the paginated results.
	Page *int32 `json:"-"`

	// PageSize: number of routes to return within a page. Maximum value is 100.
	PageSize *uint32 `json:"-"`

	// OrderBy: ordering of requested routes.
	// Default value: name_asc
	OrderBy ListRoutesRequestOrderBy `json:"-"`

	// HubID: hub ID to filter for.
	HubID *string `json:"-"`

	// Name: route name to filter for.
	Name *string `json:"-"`
}

ListRoutesRequest: list routes request.

type ListRoutesRequestOrderBy

type ListRoutesRequestOrderBy string

func (ListRoutesRequestOrderBy) MarshalJSON

func (enum ListRoutesRequestOrderBy) MarshalJSON() ([]byte, error)

func (ListRoutesRequestOrderBy) String

func (enum ListRoutesRequestOrderBy) String() string

func (*ListRoutesRequestOrderBy) UnmarshalJSON

func (enum *ListRoutesRequestOrderBy) UnmarshalJSON(data []byte) error

type ListRoutesResponse

type ListRoutesResponse struct {
	// TotalCount: total number of routes.
	TotalCount uint32 `json:"total_count"`

	// Routes: page of routes.
	Routes []*RouteSummary `json:"routes"`
}

ListRoutesResponse: list routes response.

func (*ListRoutesResponse) UnsafeAppend

func (r *ListRoutesResponse) UnsafeAppend(res interface{}) (uint32, error)

UnsafeAppend should not be used Internal usage only

func (*ListRoutesResponse) UnsafeGetTotalCount

func (r *ListRoutesResponse) UnsafeGetTotalCount() uint32

UnsafeGetTotalCount should not be used Internal usage only

type ListTwinDocumentsRequest

type ListTwinDocumentsRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// TwinID: twin ID.
	TwinID string `json:"-"`
}

ListTwinDocumentsRequest: list twin documents request.

type ListTwinDocumentsResponse

type ListTwinDocumentsResponse struct {
	// Documents: list of the twin document.
	Documents []*ListTwinDocumentsResponseDocumentSummary `json:"documents"`
}

ListTwinDocumentsResponse: list twin documents response.

type ListTwinDocumentsResponseDocumentSummary

type ListTwinDocumentsResponseDocumentSummary struct {
	// DocumentName: name of the document.
	DocumentName string `json:"document_name"`
}

ListTwinDocumentsResponseDocumentSummary: list twin documents response document summary.

type Network

type Network struct {
	// ID: network ID.
	ID string `json:"id"`

	// Name: network name.
	Name string `json:"name"`

	// Type: type of network to connect with.
	// Default value: unknown
	Type NetworkNetworkType `json:"type"`

	// Endpoint: endpoint to use for interacting with the network.
	Endpoint string `json:"endpoint"`

	// HubID: hub ID to connect the Network to.
	HubID string `json:"hub_id"`

	// CreatedAt: date at which the network was created.
	CreatedAt *time.Time `json:"created_at"`

	// TopicPrefix: this prefix will be prepended to all topics for this Network.
	TopicPrefix string `json:"topic_prefix"`
}

Network: network.

type NetworkNetworkType

type NetworkNetworkType string

func (NetworkNetworkType) MarshalJSON

func (enum NetworkNetworkType) MarshalJSON() ([]byte, error)

func (NetworkNetworkType) String

func (enum NetworkNetworkType) String() string

func (*NetworkNetworkType) UnmarshalJSON

func (enum *NetworkNetworkType) UnmarshalJSON(data []byte) error

type PatchTwinDocumentRequest

type PatchTwinDocumentRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// TwinID: twin ID.
	TwinID string `json:"-"`

	// DocumentName: name of the document.
	DocumentName string `json:"-"`

	// Version: if set, ensures that the current version of the document matches before persisting the update.
	Version *uint32 `json:"version,omitempty"`

	// Data: a json data that will be applied on the document's current data.
	// Patching rules:
	// * The patch goes recursively through the patch objects.
	// * If the patch object property is null, it is removed from the final object.
	// * If the patch object property is a value (number, strings, bool, arrays), it is replaced.
	// * If the patch object property is an object, the previous rules will be applied recursively on it.
	Data *scw.JSONObject `json:"data,omitempty"`
}

PatchTwinDocumentRequest: patch twin document request.

type PutTwinDocumentRequest

type PutTwinDocumentRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// TwinID: twin ID.
	TwinID string `json:"-"`

	// DocumentName: name of the document.
	DocumentName string `json:"-"`

	// Version: if set, ensures that the current version of the document matches before persisting the update.
	Version *uint32 `json:"version,omitempty"`

	// Data: new data that will replace the contents of the document.
	Data *scw.JSONObject `json:"data,omitempty"`
}

PutTwinDocumentRequest: put twin document request.

type RenewDeviceCertificateRequest

type RenewDeviceCertificateRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// DeviceID: device ID.
	DeviceID string `json:"-"`
}

RenewDeviceCertificateRequest: renew device certificate request.

type RenewDeviceCertificateResponse

type RenewDeviceCertificateResponse struct {
	// Device: information related to the created device.
	Device *Device `json:"device"`

	// Certificate: device certificate.
	Certificate *Certificate `json:"certificate"`
}

RenewDeviceCertificateResponse: renew device certificate response.

type Route

type Route struct {
	// ID: route ID.
	ID string `json:"id"`

	// Name: route name.
	Name string `json:"name"`

	// HubID: hub ID of the route.
	HubID string `json:"hub_id"`

	// Topic: topic the route subscribes to. It must be a valid MQTT topic and up to 65535 characters.
	Topic string `json:"topic"`

	// Type: route type.
	// Default value: unknown
	Type RouteRouteType `json:"type"`

	// CreatedAt: date at which the route was created.
	CreatedAt *time.Time `json:"created_at"`

	// S3Config: when using S3 Route, S3-specific configuration fields.
	// Precisely one of S3Config, DbConfig, RestConfig must be set.
	S3Config *RouteS3Config `json:"s3_config,omitempty"`

	// DbConfig: when using Database Route, DB-specific configuration fields.
	// Precisely one of S3Config, DbConfig, RestConfig must be set.
	DbConfig *RouteDatabaseConfig `json:"db_config,omitempty"`

	// RestConfig: when using Rest Route, Rest-specific configuration fields.
	// Precisely one of S3Config, DbConfig, RestConfig must be set.
	RestConfig *RouteRestConfig `json:"rest_config,omitempty"`

	// UpdatedAt: date at which the route was last updated.
	UpdatedAt *time.Time `json:"updated_at"`
}

Route: route.

type RouteDatabaseConfig

type RouteDatabaseConfig struct {
	// Engine: database engine the route will connect to. If not specified, the default database will be 'PostgreSQL'.
	// Default value: unknown
	Engine RouteDatabaseConfigEngine `json:"engine"`

	// Host: database host.
	Host string `json:"host"`

	// Port: database port.
	Port uint32 `json:"port"`

	// Dbname: database name.
	Dbname string `json:"dbname"`

	// Username: database username. Make sure this account can execute the provided query.
	Username string `json:"username"`

	// Password: database password.
	Password string `json:"password"`

	// Query: SQL query to be executed ($TOPIC and $PAYLOAD variables are available, see documentation).
	Query string `json:"query"`
}

RouteDatabaseConfig: route database config.

type RouteDatabaseConfigEngine

type RouteDatabaseConfigEngine string

func (RouteDatabaseConfigEngine) MarshalJSON

func (enum RouteDatabaseConfigEngine) MarshalJSON() ([]byte, error)

func (RouteDatabaseConfigEngine) String

func (enum RouteDatabaseConfigEngine) String() string

func (*RouteDatabaseConfigEngine) UnmarshalJSON

func (enum *RouteDatabaseConfigEngine) UnmarshalJSON(data []byte) error

type RouteRestConfig

type RouteRestConfig struct {
	// Verb: HTTP verb used to call REST URI.
	// Default value: unknown
	Verb RouteRestConfigHTTPVerb `json:"verb"`

	// URI: URI of the REST endpoint.
	URI string `json:"uri"`

	// Headers: HTTP call extra headers.
	Headers map[string]string `json:"headers"`
}

RouteRestConfig: route rest config.

type RouteRestConfigHTTPVerb

type RouteRestConfigHTTPVerb string

func (RouteRestConfigHTTPVerb) MarshalJSON

func (enum RouteRestConfigHTTPVerb) MarshalJSON() ([]byte, error)

func (RouteRestConfigHTTPVerb) String

func (enum RouteRestConfigHTTPVerb) String() string

func (*RouteRestConfigHTTPVerb) UnmarshalJSON

func (enum *RouteRestConfigHTTPVerb) UnmarshalJSON(data []byte) error

type RouteRouteType

type RouteRouteType string

func (RouteRouteType) MarshalJSON

func (enum RouteRouteType) MarshalJSON() ([]byte, error)

func (RouteRouteType) String

func (enum RouteRouteType) String() string

func (*RouteRouteType) UnmarshalJSON

func (enum *RouteRouteType) UnmarshalJSON(data []byte) error

type RouteS3Config

type RouteS3Config struct {
	// BucketRegion: region of the S3 route's destination bucket (e.g., 'fr-par').
	BucketRegion string `json:"bucket_region"`

	// BucketName: destination bucket name of the S3 route.
	BucketName string `json:"bucket_name"`

	// ObjectPrefix: optional string to prefix object names with.
	ObjectPrefix string `json:"object_prefix"`

	// Strategy: how the S3 route's objects will be created: one per topic or one per message.
	// Default value: unknown
	Strategy RouteS3ConfigS3Strategy `json:"strategy"`
}

RouteS3Config: route s3 config.

type RouteS3ConfigS3Strategy

type RouteS3ConfigS3Strategy string

func (RouteS3ConfigS3Strategy) MarshalJSON

func (enum RouteS3ConfigS3Strategy) MarshalJSON() ([]byte, error)

func (RouteS3ConfigS3Strategy) String

func (enum RouteS3ConfigS3Strategy) String() string

func (*RouteS3ConfigS3Strategy) UnmarshalJSON

func (enum *RouteS3ConfigS3Strategy) UnmarshalJSON(data []byte) error

type RouteSummary

type RouteSummary struct {
	// ID: route ID.
	ID string `json:"id"`

	// Name: route name.
	Name string `json:"name"`

	// HubID: hub ID of the route.
	HubID string `json:"hub_id"`

	// Topic: topic the route subscribes to. It must be a valid MQTT topic and up to 65535 characters.
	Topic string `json:"topic"`

	// Type: route type.
	// Default value: unknown
	Type RouteRouteType `json:"type"`

	// CreatedAt: date at which the route was created.
	CreatedAt *time.Time `json:"created_at"`

	// UpdatedAt: date at which the route was last updated.
	UpdatedAt *time.Time `json:"updated_at"`
}

RouteSummary: route summary.

type SetDeviceCertificateRequest

type SetDeviceCertificateRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// DeviceID: device ID.
	DeviceID string `json:"-"`

	// CertificatePem: pEM-encoded custom certificate.
	CertificatePem string `json:"certificate_pem"`
}

SetDeviceCertificateRequest: set device certificate request.

type SetDeviceCertificateResponse

type SetDeviceCertificateResponse struct {
	Device *Device `json:"device"`

	CertificatePem string `json:"certificate_pem"`
}

SetDeviceCertificateResponse: set device certificate response.

type SetHubCARequest

type SetHubCARequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// HubID: hub ID.
	HubID string `json:"-"`

	// CaCertPem: cA's PEM-encoded certificate.
	CaCertPem string `json:"ca_cert_pem"`

	// ChallengeCertPem: challenge is a PEM-encoded certificate that acts as proof of possession of the CA. It must be signed by the CA, and have a Common Name equal to the Hub ID.
	ChallengeCertPem string `json:"challenge_cert_pem"`
}

SetHubCARequest: set hub ca request.

type TwinDocument

type TwinDocument struct {
	// TwinID: parent twin ID of the document.
	TwinID string `json:"twin_id"`

	// DocumentName: name of the document.
	DocumentName string `json:"document_name"`

	// Version: new version of the document.
	Version uint32 `json:"version"`

	// Data: new data related to the document.
	Data *scw.JSONObject `json:"data"`
}

TwinDocument: twin document.

type UpdateDeviceRequest

type UpdateDeviceRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// DeviceID: device ID.
	DeviceID string `json:"-"`

	// Description: description for the device.
	Description *string `json:"description,omitempty"`

	// AllowInsecure: defines whether to allow plain and server-authenticated SSL connections in addition to mutually-authenticated ones.
	AllowInsecure *bool `json:"allow_insecure,omitempty"`

	// AllowMultipleConnections: defines whether to allow multiple physical devices to connect with this device's credentials.
	AllowMultipleConnections *bool `json:"allow_multiple_connections,omitempty"`

	// MessageFilters: filter-sets to restrict the topics the device can publish/subscribe to.
	MessageFilters *DeviceMessageFilters `json:"message_filters,omitempty"`

	// HubID: change Hub for this device, additional fees may apply, see IoT Hub pricing.
	HubID *string `json:"hub_id,omitempty"`
}

UpdateDeviceRequest: update device request.

type UpdateHubRequest

type UpdateHubRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// HubID: ID of the Hub you want to update.
	HubID string `json:"-"`

	// Name: hub name (up to 255 characters).
	Name *string `json:"name,omitempty"`

	// ProductPlan: hub product plan.
	// Default value: plan_unknown
	ProductPlan HubProductPlan `json:"product_plan"`

	// DisableEvents: disable Hub events.
	DisableEvents *bool `json:"disable_events,omitempty"`

	// EventsTopicPrefix: topic prefix of Hub events.
	EventsTopicPrefix *string `json:"events_topic_prefix,omitempty"`

	// EnableDeviceAutoProvisioning: enable device auto provisioning.
	EnableDeviceAutoProvisioning *bool `json:"enable_device_auto_provisioning,omitempty"`

	// TwinsGraphiteConfig: bETA - not implemented yet.
	// Precisely one of TwinsGraphiteConfig must be set.
	TwinsGraphiteConfig *HubTwinsGraphiteConfig `json:"twins_graphite_config,omitempty"`
}

UpdateHubRequest: update hub request.

type UpdateRouteRequest

type UpdateRouteRequest struct {
	// Region: region to target. If none is passed will use default region from the config.
	Region scw.Region `json:"-"`

	// RouteID: route id.
	RouteID string `json:"-"`

	// Name: route name.
	Name *string `json:"name,omitempty"`

	// Topic: topic the route subscribes to. It must be a valid MQTT topic and up to 65535 characters.
	Topic *string `json:"topic,omitempty"`

	// S3Config: when updating S3 Route, S3-specific configuration fields.
	// Precisely one of S3Config, DbConfig, RestConfig must be set.
	S3Config *UpdateRouteRequestS3Config `json:"s3_config,omitempty"`

	// DbConfig: when updating Database Route, DB-specific configuration fields.
	// Precisely one of S3Config, DbConfig, RestConfig must be set.
	DbConfig *UpdateRouteRequestDatabaseConfig `json:"db_config,omitempty"`

	// RestConfig: when updating Rest Route, Rest-specific configuration fields.
	// Precisely one of S3Config, DbConfig, RestConfig must be set.
	RestConfig *UpdateRouteRequestRestConfig `json:"rest_config,omitempty"`
}

UpdateRouteRequest: update route request.

type UpdateRouteRequestDatabaseConfig

type UpdateRouteRequestDatabaseConfig struct {
	Host *string `json:"host"`

	Port *uint32 `json:"port"`

	Dbname *string `json:"dbname"`

	Username *string `json:"username"`

	Password *string `json:"password"`

	Query *string `json:"query"`

	// Engine: default value: unknown
	Engine RouteDatabaseConfigEngine `json:"engine"`
}

UpdateRouteRequestDatabaseConfig: update route request database config.

type UpdateRouteRequestRestConfig

type UpdateRouteRequestRestConfig struct {
	// Verb: default value: unknown
	Verb RouteRestConfigHTTPVerb `json:"verb"`

	URI *string `json:"uri"`

	Headers *map[string]string `json:"headers"`
}

UpdateRouteRequestRestConfig: update route request rest config.

type UpdateRouteRequestS3Config

type UpdateRouteRequestS3Config struct {
	BucketRegion *string `json:"bucket_region"`

	BucketName *string `json:"bucket_name"`

	ObjectPrefix *string `json:"object_prefix"`

	// Strategy: default value: unknown
	Strategy RouteS3ConfigS3Strategy `json:"strategy"`
}

UpdateRouteRequestS3Config: update route request s3 config.

type WaitForHubRequest

type WaitForHubRequest struct {
	HubID         string
	Region        scw.Region
	Timeout       *time.Duration
	RetryInterval *time.Duration
}

WaitForHubRequest is used by WaitForHub method.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL