iotsuite

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authorize

func Authorize(conf *Configuration) string

func DumpJsonRequest added in v0.0.2

func DumpJsonRequest(req *http.Request)

func DumpJsonResponse added in v0.0.2

func DumpJsonResponse(resp *http.Response)

func Get added in v0.0.2

func Get(httpClient *http.Client, url string)

func Hello

func Hello(s string) string

func InitOAuth added in v0.0.2

func InitOAuth(conf *Configuration) *http.Client

func IotmgrDevices added in v0.0.2

func IotmgrDevices(httpClient *http.Client, filter string, option string, namespaces string, fields string)

func IotmgrGroups added in v0.0.2

func IotmgrGroups(httpClient *http.Client, conf *Configuration)

func IotmgrRules added in v0.0.2

func IotmgrRules(httpClient *http.Client, conf *Configuration)

func IotmgrTasks added in v0.0.2

func IotmgrTasks(httpClient *http.Client, conf *Configuration)

func RolloutsTargets added in v0.0.2

func RolloutsTargets(httpClient *http.Client, conf *Configuration)

func ShowServiceStatusHealth added in v0.0.2

func ShowServiceStatusHealth(region string, sort string, verbose bool)

func StoreToken added in v0.0.2

func StoreToken(tokenObject *OAuthToken)

func Things added in v0.0.2

func Things(httpClient *http.Client, fields string, filter string, namespaces string)

func ThingsCount added in v0.0.2

func ThingsCount(httpClient *http.Client, filter string, namespaces string)

func ThingsSolutions added in v0.0.2

func ThingsSolutions(httpClient *http.Client, solutionId string)

Types

type Configuration

type Configuration struct {
	// OAuth
	ClientId     string `yaml:"clientId"`
	ClientSecret string `yaml:"clientSecret"`
	Scope        string `yaml:"scope"`
}

func ReadConfig

func ReadConfig() *Configuration

type OAuthToken

type OAuthToken struct {
	AccessToken string `json:"access_token"`
	ExpiresIn   int    `json:"expires_in"`
	Scope       string `json:"scope"`
	TokenType   string `json:"token_type"`
}

OAuth Token Response

{
 "access_token":"ey...",
 "expires_in":3599,
 "scope":"service:iot-hub-prod:t0262c358aab544399b78b4811bfd862b_hub/full-access service:iot-manager:0262c358-aab5-4439-9b78-b4811bfd862b_iot-manager/full-access service:iot-rollouts:0262c358-aab5-4439-9b78-b4811bfd862b_rollouts/full-access service:iot-things-eu-1:0262c358-aab5-4439-9b78-b4811bfd862b_things/full-access",
 "token_type":"bearer"
}

func LoadToken added in v0.0.2

func LoadToken() OAuthToken

type Response added in v0.0.2

type Response struct {
	Name             string            `json:"name"`
	StatusComponents []StatusComponent `json:"data"`
}

STATUS.BOSCH-IOT-SUITE.COM JSON

type StatusComponent added in v0.0.2

type StatusComponent struct {
	Id          int    `json:"id"`
	Name        string `json:"name"`
	StatusName  string `json:"status_name"`
	Description string `json:"description"`
	Link        string `json:"link"`
	Status      int    `json:"status"`
	Order       int    `json:"order"`
	UpdatedAt   string `json:"updated_at"`
}

{ "id": 1, "name": "Bosch IoT Things (EU-1)", "description": "Managed inventory of digital twins for IoT device assets", "link": "https://www.bosch-iot-suite.com/things/", "status": 1, "order": 16, "group_id": 1, "enabled": true, "meta": null, "created_at": "2018-06-15 13:09:48", "updated_at": "2020-04-20 08:30:02", "deleted_at": null, "status_name": "Operational", "tags": { "": "" } },

Jump to

Keyboard shortcuts

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