iot

package
v1.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	// DeviceMessageFiltersPolicyUnknown is [insert doc].
	DeviceMessageFiltersPolicyUnknown = DeviceMessageFiltersPolicy("unknown")
	// DeviceMessageFiltersPolicyAccept is [insert doc].
	DeviceMessageFiltersPolicyAccept = DeviceMessageFiltersPolicy("accept")
	// DeviceMessageFiltersPolicyReject is [insert doc].
	DeviceMessageFiltersPolicyReject = DeviceMessageFiltersPolicy("reject")
)
View Source
const (
	// DeviceStatusError is [insert doc].
	DeviceStatusError = DeviceStatus("error")
	// DeviceStatusEnabled is [insert doc].
	DeviceStatusEnabled = DeviceStatus("enabled")
	// DeviceStatusDisabled is [insert doc].
	DeviceStatusDisabled = DeviceStatus("disabled")
)
View Source
const (
	// HubStatusError is [insert doc].
	HubStatusError = HubStatus("error")
	// HubStatusEnabling is [insert doc].
	HubStatusEnabling = HubStatus("enabling")
	// HubStatusReady is [insert doc].
	HubStatusReady = HubStatus("ready")
	// HubStatusDisabling is [insert doc].
	HubStatusDisabling = HubStatus("disabling")
	// HubStatusDisabled is [insert doc].
	HubStatusDisabled = HubStatus("disabled")
)
View Source
const (
	// ListDevicesRequestOrderByNameAsc is [insert doc].
	ListDevicesRequestOrderByNameAsc = ListDevicesRequestOrderBy("name_asc")
	// ListDevicesRequestOrderByNameDesc is [insert doc].
	ListDevicesRequestOrderByNameDesc = ListDevicesRequestOrderBy("name_desc")
	// ListDevicesRequestOrderByStatusAsc is [insert doc].
	ListDevicesRequestOrderByStatusAsc = ListDevicesRequestOrderBy("status_asc")
	// ListDevicesRequestOrderByStatusDesc is [insert doc].
	ListDevicesRequestOrderByStatusDesc = ListDevicesRequestOrderBy("status_desc")
	// ListDevicesRequestOrderByHubIDAsc is [insert doc].
	ListDevicesRequestOrderByHubIDAsc = ListDevicesRequestOrderBy("hub_id_asc")
	// ListDevicesRequestOrderByHubIDDesc is [insert doc].
	ListDevicesRequestOrderByHubIDDesc = ListDevicesRequestOrderBy("hub_id_desc")
	// ListDevicesRequestOrderByCreatedAtAsc is [insert doc].
	ListDevicesRequestOrderByCreatedAtAsc = ListDevicesRequestOrderBy("created_at_asc")
	// ListDevicesRequestOrderByCreatedAtDesc is [insert doc].
	ListDevicesRequestOrderByCreatedAtDesc = ListDevicesRequestOrderBy("created_at_desc")
	// ListDevicesRequestOrderByUpdatedAtAsc is [insert doc].
	ListDevicesRequestOrderByUpdatedAtAsc = ListDevicesRequestOrderBy("updated_at_asc")
	// ListDevicesRequestOrderByUpdatedAtDesc is [insert doc].
	ListDevicesRequestOrderByUpdatedAtDesc = ListDevicesRequestOrderBy("updated_at_desc")
	// ListDevicesRequestOrderByAllowInsecureAsc is [insert doc].
	ListDevicesRequestOrderByAllowInsecureAsc = ListDevicesRequestOrderBy("allow_insecure_asc")
	// ListDevicesRequestOrderByAllowInsecureDesc is [insert doc].
	ListDevicesRequestOrderByAllowInsecureDesc = ListDevicesRequestOrderBy("allow_insecure_desc")
)
View Source
const (
	// ListHubsRequestOrderByNameAsc is [insert doc].
	ListHubsRequestOrderByNameAsc = ListHubsRequestOrderBy("name_asc")
	// ListHubsRequestOrderByNameDesc is [insert doc].
	ListHubsRequestOrderByNameDesc = ListHubsRequestOrderBy("name_desc")
	// ListHubsRequestOrderByStatusAsc is [insert doc].
	ListHubsRequestOrderByStatusAsc = ListHubsRequestOrderBy("status_asc")
	// ListHubsRequestOrderByStatusDesc is [insert doc].
	ListHubsRequestOrderByStatusDesc = ListHubsRequestOrderBy("status_desc")
	// ListHubsRequestOrderByProductPlanAsc is [insert doc].
	ListHubsRequestOrderByProductPlanAsc = ListHubsRequestOrderBy("product_plan_asc")
	// ListHubsRequestOrderByProductPlanDesc is [insert doc].
	ListHubsRequestOrderByProductPlanDesc = ListHubsRequestOrderBy("product_plan_desc")
	// ListHubsRequestOrderByCreatedAtAsc is [insert doc].
	ListHubsRequestOrderByCreatedAtAsc = ListHubsRequestOrderBy("created_at_asc")
	// ListHubsRequestOrderByCreatedAtDesc is [insert doc].
	ListHubsRequestOrderByCreatedAtDesc = ListHubsRequestOrderBy("created_at_desc")
	// ListHubsRequestOrderByUpdatedAtAsc is [insert doc].
	ListHubsRequestOrderByUpdatedAtAsc = ListHubsRequestOrderBy("updated_at_asc")
	// ListHubsRequestOrderByUpdatedAtDesc is [insert doc].
	ListHubsRequestOrderByUpdatedAtDesc = ListHubsRequestOrderBy("updated_at_desc")
)
View Source
const (
	// ListNetworksRequestOrderByNameAsc is [insert doc].
	ListNetworksRequestOrderByNameAsc = ListNetworksRequestOrderBy("name_asc")
	// ListNetworksRequestOrderByNameDesc is [insert doc].
	ListNetworksRequestOrderByNameDesc = ListNetworksRequestOrderBy("name_desc")
	// ListNetworksRequestOrderByTypeAsc is [insert doc].
	ListNetworksRequestOrderByTypeAsc = ListNetworksRequestOrderBy("type_asc")
	// ListNetworksRequestOrderByTypeDesc is [insert doc].
	ListNetworksRequestOrderByTypeDesc = ListNetworksRequestOrderBy("type_desc")
	// ListNetworksRequestOrderByCreatedAtAsc is [insert doc].
	ListNetworksRequestOrderByCreatedAtAsc = ListNetworksRequestOrderBy("created_at_asc")
	// ListNetworksRequestOrderByCreatedAtDesc is [insert doc].
	ListNetworksRequestOrderByCreatedAtDesc = ListNetworksRequestOrderBy("created_at_desc")
)
View Source
const (
	// ListRoutesRequestOrderByNameAsc is [insert doc].
	ListRoutesRequestOrderByNameAsc = ListRoutesRequestOrderBy("name_asc")
	// ListRoutesRequestOrderByNameDesc is [insert doc].
	ListRoutesRequestOrderByNameDesc = ListRoutesRequestOrderBy("name_desc")
	// ListRoutesRequestOrderByHubIDAsc is [insert doc].
	ListRoutesRequestOrderByHubIDAsc = ListRoutesRequestOrderBy("hub_id_asc")
	// ListRoutesRequestOrderByHubIDDesc is [insert doc].
	ListRoutesRequestOrderByHubIDDesc = ListRoutesRequestOrderBy("hub_id_desc")
	// ListRoutesRequestOrderByTypeAsc is [insert doc].
	ListRoutesRequestOrderByTypeAsc = ListRoutesRequestOrderBy("type_asc")
	// ListRoutesRequestOrderByTypeDesc is [insert doc].
	ListRoutesRequestOrderByTypeDesc = ListRoutesRequestOrderBy("type_desc")
	// ListRoutesRequestOrderByCreatedAtAsc is [insert doc].
	ListRoutesRequestOrderByCreatedAtAsc = ListRoutesRequestOrderBy("created_at_asc")
	// ListRoutesRequestOrderByCreatedAtDesc is [insert doc].
	ListRoutesRequestOrderByCreatedAtDesc = ListRoutesRequestOrderBy("created_at_desc")
)
View Source
const (
	// MetricsPeriodHour is [insert doc].
	MetricsPeriodHour = MetricsPeriod("hour")
	// MetricsPeriodDay is [insert doc].
	MetricsPeriodDay = MetricsPeriod("day")
	// MetricsPeriodWeek is [insert doc].
	MetricsPeriodWeek = MetricsPeriod("week")
	// MetricsPeriodMonth is [insert doc].
	MetricsPeriodMonth = MetricsPeriod("month")
	// MetricsPeriodYear is [insert doc].
	MetricsPeriodYear = MetricsPeriod("year")
)
View Source
const (
	// NetworkNetworkTypeUnknown is [insert doc].
	NetworkNetworkTypeUnknown = NetworkNetworkType("unknown")
	// NetworkNetworkTypeSigfox is [insert doc].
	NetworkNetworkTypeSigfox = NetworkNetworkType("sigfox")
	// NetworkNetworkTypeRest is [insert doc].
	NetworkNetworkTypeRest = NetworkNetworkType("rest")
)
View Source
const (
	// ProductPlanPlanUnknown is [insert doc].
	ProductPlanPlanUnknown = ProductPlan("plan_unknown")
	// ProductPlanPlanShared is [insert doc].
	ProductPlanPlanShared = ProductPlan("plan_shared")
	// ProductPlanPlanDedicated is [insert doc].
	ProductPlanPlanDedicated = ProductPlan("plan_dedicated")
	// ProductPlanPlanHa is [insert doc].
	ProductPlanPlanHa = ProductPlan("plan_ha")
)
View Source
const (
	// RestRouteHTTPVerbGet is [insert doc].
	RestRouteHTTPVerbGet = RestRouteHTTPVerb("get")
	// RestRouteHTTPVerbPost is [insert doc].
	RestRouteHTTPVerbPost = RestRouteHTTPVerb("post")
	// RestRouteHTTPVerbPut is [insert doc].
	RestRouteHTTPVerbPut = RestRouteHTTPVerb("put")
	// RestRouteHTTPVerbPatch is [insert doc].
	RestRouteHTTPVerbPatch = RestRouteHTTPVerb("patch")
	// RestRouteHTTPVerbDelete is [insert doc].
	RestRouteHTTPVerbDelete = RestRouteHTTPVerb("delete")
)
View Source
const (
	// RouteRouteTypeUnknown is [insert doc].
	RouteRouteTypeUnknown = RouteRouteType("unknown")
	// RouteRouteTypeS3 is [insert doc].
	RouteRouteTypeS3 = RouteRouteType("s3")
	// RouteRouteTypeFunctions is [insert doc].
	RouteRouteTypeFunctions = RouteRouteType("functions")
	// RouteRouteTypeDatabase is [insert doc].
	RouteRouteTypeDatabase = RouteRouteType("database")
	// RouteRouteTypeRest is [insert doc].
	RouteRouteTypeRest = RouteRouteType("rest")
)
View Source
const (
	// S3RouteStrategyPerTopic is [insert doc].
	S3RouteStrategyPerTopic = S3RouteStrategy("per_topic")
	// S3RouteStrategyPerMessage is [insert doc].
	S3RouteStrategyPerMessage = S3RouteStrategy("per_message")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API: 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) CreateDatabaseRoute

func (s *API) CreateDatabaseRoute(req *CreateDatabaseRouteRequest, opts ...scw.RequestOption) (*DatabaseRoute, error)

CreateDatabaseRoute: create a Database route

Create a route that will record subscribed MQTT messages into your database. <b>You need to manage the database by yourself</b>.

func (*API) CreateDevice

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

CreateDevice: add a device

func (*API) CreateFunctionsRoute

func (s *API) CreateFunctionsRoute(req *CreateFunctionsRouteRequest, opts ...scw.RequestOption) (*FunctionsRoute, error)

CreateFunctionsRoute: create a Functions route

Create a route that will forward subscribed MQTT messages to a function and publish the returned payload (if provided). <b>You need to create the function by yourself</b>.

func (*API) CreateHub

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

CreateHub: create a hub

func (*API) CreateNetwork

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

CreateNetwork: create a new Network

func (*API) CreateRestRoute

func (s *API) CreateRestRoute(req *CreateRestRouteRequest, opts ...scw.RequestOption) (*RestRoute, error)

CreateRestRoute: create a Rest route

Create a route that will call a REST API on received subscribed MQTT messages.

func (*API) CreateS3Route

func (s *API) CreateS3Route(req *CreateS3RouteRequest, opts ...scw.RequestOption) (*S3Route, error)

CreateS3Route: create an S3 route

Create a route that will put subscribed MQTT messages into an S3 bucket. You need to create the bucket yourself and grant us write access: ```bash > s3cmd setacl s3://<my-bucket> --acl-grant=write:555c69c3-87d0-4bf8-80f1-99a2f757d031:555c69c3-87d0-4bf8-80f1-99a2f757d031 ```

func (*API) DeleteDatabaseRoute

func (s *API) DeleteDatabaseRoute(req *DeleteDatabaseRouteRequest, opts ...scw.RequestOption) error

DeleteDatabaseRoute: delete a Database route

func (*API) DeleteDevice

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

DeleteDevice: remove a device

func (*API) DeleteFunctionsRoute

func (s *API) DeleteFunctionsRoute(req *DeleteFunctionsRouteRequest, opts ...scw.RequestOption) error

DeleteFunctionsRoute: delete a Functions route

func (*API) DeleteHub

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

DeleteHub: delete a hub

func (*API) DeleteNetwork

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

DeleteNetwork: delete a Network

func (*API) DeleteRestRoute

func (s *API) DeleteRestRoute(req *DeleteRestRouteRequest, opts ...scw.RequestOption) error

DeleteRestRoute: delete a Rest route

func (*API) DeleteS3Route

func (s *API) DeleteS3Route(req *DeleteS3RouteRequest, opts ...scw.RequestOption) error

DeleteS3Route: delete an S3 route

func (*API) DisableDevice

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

DisableDevice: disable a device

func (*API) DisableHub

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

DisableHub: disable a hub

func (*API) EnableDevice

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

EnableDevice: enable a device

func (*API) EnableHub

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

EnableHub: enable a hub

func (*API) GetDatabaseRoute

func (s *API) GetDatabaseRoute(req *GetDatabaseRouteRequest, opts ...scw.RequestOption) (*DatabaseRoute, error)

GetDatabaseRoute: get a Database route

func (*API) GetDevice

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

GetDevice: get a device

func (*API) GetDeviceMetrics

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

GetDeviceMetrics: get a device's metrics

func (*API) GetFunctionsRoute

func (s *API) GetFunctionsRoute(req *GetFunctionsRouteRequest, opts ...scw.RequestOption) (*FunctionsRoute, error)

GetFunctionsRoute: get a Functions route

func (*API) GetHub

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

GetHub: get a hub

func (*API) GetHubMetrics

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

GetHubMetrics: get a hub's metrics

func (*API) GetNetwork

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

GetNetwork: retrieve a specific Network

func (*API) GetRestRoute

func (s *API) GetRestRoute(req *GetRestRouteRequest, opts ...scw.RequestOption) (*RestRoute, error)

GetRestRoute: get a Rest route

func (*API) GetS3Route

func (s *API) GetS3Route(req *GetS3RouteRequest, opts ...scw.RequestOption) (*S3Route, error)

GetS3Route: get an S3 route

func (*API) GetServiceInfo

func (s *API) GetServiceInfo(req *GetServiceInfoRequest, opts ...scw.RequestOption) (*scw.ServiceInfo, error)

func (*API) ListDevices

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

ListDevices: list devices

func (*API) ListHubs

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

ListHubs: list hubs

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 routes

func (*API) UpdateDevice

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

UpdateDevice: update a device

func (*API) UpdateHub

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

UpdateHub: update a hub

func (*API) WaitForHub

func (s *API) WaitForHub(req *WaitForHubRequest) (*Hub, error)

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

type CreateDatabaseRouteRequest

type CreateDatabaseRouteRequest struct {
	Region scw.Region `json:"-"`
	// Name: name of the route
	Name string `json:"name"`
	// HubID: ID of the route's hub
	HubID string `json:"hub_id"`
	// Topic: topic the route subscribes to (wildcards allowed). It must be a valid MQTT topic and up to 65535 characters
	Topic string `json:"topic"`
	// Query: SQL query to be executed ($TOPIC and $PAYLOAD variables are available, see documentation)
	Query string `json:"query"`
	// Database: database settings
	Database *DatabaseSettings `json:"database"`
}

type CreateDeviceRequest

type CreateDeviceRequest struct {
	Region scw.Region `json:"-"`
	// Name: device name
	Name string `json:"name"`
	// HubID: ID of the device's hub
	HubID string `json:"hub_id"`
	// AllowInsecure: allow plain and server-authenticated SSL connections in addition to mutually-authenticated ones
	AllowInsecure bool `json:"allow_insecure"`
	// MessageFilters: filter-sets to authorize or deny the device to publish/subscribe to specific topics
	MessageFilters *DeviceMessageFilters `json:"message_filters"`
}

type CreateDeviceResponse

type CreateDeviceResponse struct {
	// Device: created device information
	Device *Device `json:"device"`
	// Crt: device certificate
	Crt string `json:"crt"`
	// Key: device certificate key
	Key string `json:"key"`
}

CreateDeviceResponse: create device response

type CreateFunctionsRouteRequest

type CreateFunctionsRouteRequest struct {
	Region scw.Region `json:"-"`
	// Name: name of the route
	Name string `json:"name"`
	// HubID: ID of the route's hub
	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"`
	// URI: uri of the function
	URI string `json:"uri"`
	// Token: authentication JWT token
	Token *string `json:"token"`
}

type CreateHubRequest

type CreateHubRequest struct {
	Region scw.Region `json:"-"`
	// Name: hub name (up to 255 characters)
	Name string `json:"name"`
	// OrganizationID: organization owning the resource
	OrganizationID string `json:"organization_id"`
	// ProductPlan: hub feature set
	//
	// Default value: plan_shared
	ProductPlan ProductPlan `json:"product_plan"`
	// DisableEvents: disable Hub events (default false)
	DisableEvents *bool `json:"disable_events"`
	// EventsTopicPrefix: hub events topic prefix (default '$SCW/events')
	EventsTopicPrefix *string `json:"events_topic_prefix"`
}

type CreateNetworkRequest

type CreateNetworkRequest struct {
	Region scw.Region `json:"-"`
	// Name: network name
	Name string `json:"name"`
	// Deprecated: OrganizationID: deprecated: Organization owning the resource, do not use
	//
	// Will always be assigned to the organization owning the IoT hub.
	OrganizationID string `json:"organization_id"`
	// 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"`
}

type CreateNetworkResponse

type CreateNetworkResponse struct {
	// Network: 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 CreateRestRouteRequest

type CreateRestRouteRequest struct {
	Region scw.Region `json:"-"`
	// Name: name of the route
	Name string `json:"name"`
	// HubID: ID of the route's hub
	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"`
	// Verb: HTTP Verb used to call REST URI
	//
	// Default value: get
	Verb RestRouteHTTPVerb `json:"verb"`
	// URI: URI of the REST endpoint
	URI string `json:"uri"`
	// Headers: HTTP call extra headers
	Headers map[string]string `json:"headers"`
}

type CreateS3RouteRequest

type CreateS3RouteRequest struct {
	Region scw.Region `json:"-"`
	// Name: name of the route
	Name string `json:"name"`
	// HubID: ID of the route's hub
	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"`
	// BucketRegion: region of the S3 route's destination bucket (eg 'fr-par')
	BucketRegion string `json:"bucket_region"`
	// BucketName: name of the S3 route's destination bucket
	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: per_topic
	Strategy S3RouteStrategy `json:"strategy"`
}

type DatabaseRoute

type DatabaseRoute struct {
	// ID: route ID
	ID string `json:"id"`
	// Name: route name
	Name string `json:"name"`
	// OrganizationID: organization owning the route
	OrganizationID string `json:"organization_id"`
	// HubID: ID of the route's hub
	HubID string `json:"hub_id"`
	// Topic: topic the route subscribes to (wildcards allowed). It must be a valid MQTT topic and up to 65535 characters
	Topic string `json:"topic"`
	// CreatedAt: route creation date
	CreatedAt *time.Time `json:"created_at"`
	// Query: SQL query to be executed ($TOPIC and $PAYLOAD variables are available, see documentation)
	Query string `json:"query"`
	// Database: database settings
	Database *DatabaseSettings `json:"database"`
}

DatabaseRoute: database route

type DatabaseSettings

type DatabaseSettings struct {
	// 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"`
}

DatabaseSettings: database settings

type DeleteDatabaseRouteRequest

type DeleteDatabaseRouteRequest struct {
	Region scw.Region `json:"-"`
	// RouteID: route ID
	RouteID string `json:"-"`
}

type DeleteDeviceRequest

type DeleteDeviceRequest struct {
	Region scw.Region `json:"-"`
	// DeviceID: device ID
	DeviceID string `json:"-"`
}

type DeleteFunctionsRouteRequest

type DeleteFunctionsRouteRequest struct {
	Region scw.Region `json:"-"`
	// RouteID: route ID
	RouteID string `json:"-"`
}

type DeleteHubRequest

type DeleteHubRequest struct {
	Region scw.Region `json:"-"`
	// HubID: hub ID
	HubID string `json:"-"`
	// DeleteDevices: force deletion of devices added to this hub instead of rejecting operation
	DeleteDevices *bool `json:"delete_devices"`
}

type DeleteNetworkRequest

type DeleteNetworkRequest struct {
	Region scw.Region `json:"-"`
	// NetworkID: network ID
	NetworkID string `json:"-"`
}

type DeleteRestRouteRequest

type DeleteRestRouteRequest struct {
	Region scw.Region `json:"-"`
	// RouteID: route ID
	RouteID string `json:"-"`
}

type DeleteS3RouteRequest

type DeleteS3RouteRequest struct {
	Region scw.Region `json:"-"`
	// RouteID: route ID
	RouteID string `json:"-"`
}

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"`
	// Status: device status
	//
	// Default value: error
	Status DeviceStatus `json:"status"`
	// HubID: hub ID
	HubID string `json:"hub_id"`
	// LastActivityAt: device last connection/activity date
	LastActivityAt *time.Time `json:"last_activity_at"`
	// IsConnected: whether the device is connected to the Hub or not
	IsConnected bool `json:"is_connected"`
	// AllowInsecure: whether to allow device to connect without TLS mutual authentication
	AllowInsecure bool `json:"allow_insecure"`
	// MessageFilters: filter-sets to restrict the topics the device can publish/subscribe to
	MessageFilters *DeviceMessageFilters `json:"message_filters"`
	// CreatedAt: device add date
	CreatedAt *time.Time `json:"created_at"`
	// UpdatedAt: device last modification date
	UpdatedAt *time.Time `json:"updated_at"`
	// OrganizationID: organization owning the resource
	OrganizationID string `json:"organization_id"`
}

Device: device

type DeviceMessageFilters

type DeviceMessageFilters struct {
	// Publish: filter-set to restrict topics the device can publish to
	Publish *DeviceMessageFiltersMessageFilterSet `json:"publish"`
	// Subscribe: filter-set to restrict topics the device can subscribe to
	Subscribe *DeviceMessageFiltersMessageFilterSet `json:"subscribe"`
}

DeviceMessageFilters: device message filters

type DeviceMessageFiltersMessageFilterSet

type DeviceMessageFiltersMessageFilterSet struct {
	// Policy:
	//
	// Default value: unknown
	Policy DeviceMessageFiltersPolicy `json:"policy"`

	Topics *[]string `json:"topics"`
}

type DeviceMessageFiltersPolicy

type DeviceMessageFiltersPolicy string

func (DeviceMessageFiltersPolicy) MarshalJSON

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

func (DeviceMessageFiltersPolicy) String

func (enum DeviceMessageFiltersPolicy) String() string

func (*DeviceMessageFiltersPolicy) UnmarshalJSON

func (enum *DeviceMessageFiltersPolicy) 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 scw.Region `json:"-"`
	// DeviceID: device ID
	DeviceID string `json:"-"`
}

type DisableHubRequest

type DisableHubRequest struct {
	Region scw.Region `json:"-"`
	// HubID: hub ID
	HubID string `json:"-"`
}

type EnableDeviceRequest

type EnableDeviceRequest struct {
	Region scw.Region `json:"-"`
	// DeviceID: device ID
	DeviceID string `json:"-"`
}

type EnableHubRequest

type EnableHubRequest struct {
	Region scw.Region `json:"-"`
	// HubID: hub ID
	HubID string `json:"-"`
}

type FunctionsRoute

type FunctionsRoute struct {
	// ID: route ID
	ID string `json:"id"`
	// Name: route name
	Name string `json:"name"`
	// OrganizationID: organization owning the route
	OrganizationID string `json:"organization_id"`
	// HubID: ID of the route's hub
	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"`
	// CreatedAt: route creation date
	CreatedAt *time.Time `json:"created_at"`
	// URI: uri of the function
	URI string `json:"uri"`
}

FunctionsRoute: functions route

type GetDatabaseRouteRequest

type GetDatabaseRouteRequest struct {
	Region scw.Region `json:"-"`
	// RouteID: route ID
	RouteID string `json:"-"`
}

type GetDeviceMetricsRequest

type GetDeviceMetricsRequest struct {
	Region scw.Region `json:"-"`
	// DeviceID: device ID
	DeviceID string `json:"-"`
	// Period: period over which the metrics span
	//
	// Default value: hour
	Period MetricsPeriod `json:"-"`
}

type GetDeviceRequest

type GetDeviceRequest struct {
	Region scw.Region `json:"-"`
	// DeviceID: device ID
	DeviceID string `json:"-"`
}

type GetFunctionsRouteRequest

type GetFunctionsRouteRequest struct {
	Region scw.Region `json:"-"`
	// RouteID: route ID
	RouteID string `json:"-"`
}

type GetHubMetricsRequest

type GetHubMetricsRequest struct {
	Region scw.Region `json:"-"`
	// HubID: hub ID
	HubID string `json:"-"`
	// Period: period over which the metrics span
	//
	// Default value: hour
	Period MetricsPeriod `json:"-"`
}

type GetHubRequest

type GetHubRequest struct {
	Region scw.Region `json:"-"`
	// HubID: hub ID
	HubID string `json:"-"`
}

type GetNetworkRequest

type GetNetworkRequest struct {
	Region scw.Region `json:"-"`
	// NetworkID: network ID
	NetworkID string `json:"-"`
}

type GetRestRouteRequest

type GetRestRouteRequest struct {
	Region scw.Region `json:"-"`
	// RouteID: route ID
	RouteID string `json:"-"`
}

type GetS3RouteRequest

type GetS3RouteRequest struct {
	Region scw.Region `json:"-"`
	// RouteID: route ID
	RouteID string `json:"-"`
}

type GetServiceInfoRequest

type GetServiceInfoRequest struct {
	Region scw.Region `json:"-"`
}

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: error
	Status HubStatus `json:"status"`
	// ProductPlan: hub feature set
	//
	// Default value: plan_unknown
	ProductPlan ProductPlan `json:"product_plan"`
	// Enabled: 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: host to connect your devices to
	//
	// 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"`
	// EventsEnabled: wether Hub events are enabled or not
	EventsEnabled bool `json:"events_enabled"`
	// 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"`
	// OrganizationID: organization owning the resource
	OrganizationID string `json:"organization_id"`
}

Hub: hub

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 ListDevicesRequest

type ListDevicesRequest struct {
	Region scw.Region `json:"-"`
	// Page: page number
	Page *int32 `json:"-"`
	// PageSize: page size. The maximum value is 100
	PageSize *uint32 `json:"-"`
	// OrderBy: ordering of requested devices
	//
	// Default value: name_asc
	OrderBy ListDevicesRequestOrderBy `json:"-"`
	// OrganizationID: filter on the organization
	OrganizationID *string `json:"-"`
	// Name: filter on the name
	Name *string `json:"-"`
	// HubID: filter on the hub
	HubID *string `json:"-"`
	// Deprecated: Enabled: deprecated, ignored filter
	Enabled *bool `json:"-"`
	// AllowInsecure: filter on the allow_insecure flag
	AllowInsecure *bool `json:"-"`
	// Deprecated: IsConnected: deprecated, ignored filter
	IsConnected *bool `json:"-"`
}

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: a 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 scw.Region `json:"-"`
	// Page: page number
	Page *int32 `json:"-"`
	// PageSize: page size. The maximum value is 100
	PageSize *uint32 `json:"-"`
	// OrderBy: ordering of requested hub
	//
	// Default value: name_asc
	OrderBy ListHubsRequestOrderBy `json:"-"`
	// OrganizationID: filter on the organization
	OrganizationID *string `json:"-"`
	// Name: filter on the name
	Name *string `json:"-"`
}

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 scw.Region `json:"-"`
	// Page: page number
	Page *int32 `json:"-"`
	// PageSize: page size. The maximum value is 100
	PageSize *uint32 `json:"-"`
	// OrderBy: ordering of requested routes
	//
	// Default value: name_asc
	OrderBy ListNetworksRequestOrderBy `json:"-"`
	// OrganizationID: filter on the organization
	OrganizationID *string `json:"-"`
	// Name: filter on Network name
	Name *string `json:"-"`
	// HubID: filter on the hub
	HubID *string `json:"-"`
	// TopicPrefix: filter on the topic prefix
	TopicPrefix *string `json:"-"`
}

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: a 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 scw.Region `json:"-"`
	// Page: page number
	Page *int32 `json:"-"`
	// PageSize: page size. The maximum value is 100
	PageSize *uint32 `json:"-"`
	// OrderBy: ordering of requested routes
	//
	// Default value: name_asc
	OrderBy ListRoutesRequestOrderBy `json:"-"`
	// OrganizationID: filter on the organization
	OrganizationID *string `json:"-"`
	// HubID: filter on the hub
	HubID *string `json:"-"`
	// Name: filter on route's name
	Name *string `json:"-"`
}

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: a page of routes
	Routes []*Route `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 Metrics

type Metrics struct {
	// Metrics: metrics for a hub or a device, over the requested period
	Metrics []*MetricsMetric `json:"metrics"`
}

Metrics: metrics

type MetricsMetric

type MetricsMetric struct {
	// Name: metric name
	Name string `json:"name"`
	// Values: metric values over the selected period
	Values []*MetricsMetricValue `json:"values"`
}

MetricsMetric: metrics. metric

type MetricsMetricValue

type MetricsMetricValue struct {
	// Time: timestamp for the value
	Time *time.Time `json:"time"`
	// Value: numeric value
	Value int64 `json:"value"`
}

MetricsMetricValue: metrics. metric. value

type MetricsPeriod

type MetricsPeriod string

func (MetricsPeriod) MarshalJSON

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

func (MetricsPeriod) String

func (enum MetricsPeriod) String() string

func (*MetricsPeriod) UnmarshalJSON

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

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: network creation date
	CreatedAt *time.Time `json:"created_at"`
	// TopicPrefix: topic prefix for the Network
	//
	// This prefix will be prepended to all topics for this Network.
	TopicPrefix string `json:"topic_prefix"`
	// Region: region of the Network
	Region scw.Region `json:"region"`
	// OrganizationID: organization owning the resource
	OrganizationID string `json:"organization_id"`
}

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 ProductPlan

type ProductPlan string

func (ProductPlan) MarshalJSON

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

func (ProductPlan) String

func (enum ProductPlan) String() string

func (*ProductPlan) UnmarshalJSON

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

type RestRoute

type RestRoute struct {
	// ID: route ID
	ID string `json:"id"`
	// Name: route name
	Name string `json:"name"`
	// OrganizationID: organization owning the route
	OrganizationID string `json:"organization_id"`
	// HubID: ID of the route's hub
	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"`
	// CreatedAt: route creation date
	CreatedAt *time.Time `json:"created_at"`
	// Verb: HTTP Verb used to call REST URI
	//
	// Default value: get
	Verb RestRouteHTTPVerb `json:"verb"`
	// URI: URI of the REST endpoint
	URI string `json:"uri"`
	// Headers: HTTP call extra headers
	Headers map[string]string `json:"headers"`
}

RestRoute: rest route

type RestRouteHTTPVerb

type RestRouteHTTPVerb string

func (RestRouteHTTPVerb) MarshalJSON

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

func (RestRouteHTTPVerb) String

func (enum RestRouteHTTPVerb) String() string

func (*RestRouteHTTPVerb) UnmarshalJSON

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

type Route

type Route struct {
	// ID: route ID
	ID string `json:"id"`
	// Name: route name
	Name string `json:"name"`
	// OrganizationID: organization owning the resource
	OrganizationID string `json:"organization_id"`
	// HubID: ID of the route's hub
	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: route creation date
	CreatedAt *time.Time `json:"created_at"`
}

Route: route

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 S3Route

type S3Route struct {
	// ID: route ID
	ID string `json:"id"`
	// Name: route name
	Name string `json:"name"`
	// OrganizationID: organization owning the route
	OrganizationID string `json:"organization_id"`
	// HubID: ID of the route's hub
	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"`
	// CreatedAt: route creation date
	CreatedAt *time.Time `json:"created_at"`
	// BucketRegion: region of the S3 route's destination bucket (eg 'fr-par')
	BucketRegion string `json:"bucket_region"`
	// BucketName: name of the S3 route's destination bucket
	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: per_topic
	Strategy S3RouteStrategy `json:"strategy"`
}

S3Route: s3 route

type S3RouteStrategy

type S3RouteStrategy string

func (S3RouteStrategy) MarshalJSON

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

func (S3RouteStrategy) String

func (enum S3RouteStrategy) String() string

func (*S3RouteStrategy) UnmarshalJSON

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

type UpdateDeviceRequest

type UpdateDeviceRequest struct {
	Region scw.Region `json:"-"`
	// DeviceID: device ID
	DeviceID string `json:"-"`
	// Name: device name
	Name *string `json:"name"`
	// AllowInsecure: allow plain and server-authenticated SSL connections in addition to mutually-authenticated ones
	AllowInsecure *bool `json:"allow_insecure"`
	// MessageFilters: filter-sets to restrict the topics the device can publish/subscribe to
	MessageFilters *DeviceMessageFilters `json:"message_filters"`
	// HubID: change Hub for this device, additional fees may apply, see IoT Hub pricing
	HubID *string `json:"hub_id"`
}

type UpdateHubRequest

type UpdateHubRequest struct {
	Region scw.Region `json:"-"`
	// HubID: hub ID
	HubID string `json:"-"`
	// Name: hub name (up to 255 characters)
	Name *string `json:"name"`
	// ProductPlan: hub feature set
	//
	// Default value: plan_unknown
	ProductPlan ProductPlan `json:"product_plan"`
	// DisableEvents: disable Hub events
	DisableEvents *bool `json:"disable_events"`
	// EventsTopicPrefix: hub events topic prefix
	EventsTopicPrefix *string `json:"events_topic_prefix"`
}

type WaitForHubRequest

type WaitForHubRequest struct {
	HubID         string
	Region        scw.Region
	Status        HubStatus
	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