iotdevprov

package module
v0.0.0-...-1573489 Latest Latest
Warning

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

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

README

Go API client for iotdevprov

The Device Provisioning API is used to provision new devices for the Bosch IoT Suite services. It simplifies provisioning by registering the device in all affected services with a single API call.

Currently the Bosch IoT Hub and Bosch IoT Things service are supported. The following entities can be provisioned:

  • Device (Bosch IoT Hub): The Bosch IoT Hub has to be made aware of the Device which will connect to it and send telemetry data.
  • Credentials (Bosch IoT Hub): Credentials are required to authenticate Devices which want to connect. If Devices connect via a gateway, only credentials for the gateway are required. Hence, Credentials are optional in the Device Provisioning API.
  • Thing (Bosch IoT Things): A Thing is a Digital Twin: Among other things, it stores the state of the Device and provides an API for it, which is also called Device-as-a-Service. Vorto models can be used to define the capabilities of a Thing.
  • Policy (Bosch IoT Things): Each Thing must have a reference (policyId) to a Policy which defines its access control. You can decide to create a specific Policy for each Thing or to re-use a Policy for multiple Things.

Authentication and authorization of the Device Provisioning API is based on Suite Auth access tokens. You have to create a Suite Auth access token which provides full access to the Bosch IoT Hub and Bosch IoT Things service instances you want to address and provide it as Bearer Authorization.

Note: If you are using the Asset communication package hybrid offering please use the following server:

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional

Put the package under your project folder and add the following in import:

import "./iotdevprov"

Documentation for API Endpoints

All URIs are relative to https://deviceprovisioning.eu-1.bosch-iot-suite.com/api/1

Class Method HTTP request Description
DeProvisioningApi ServiceInstanceIdDevicesDeviceIdDelete Delete /{service-instance-id}/devices/{device-id} De-provisioning a device: Deletes the device, thing, policy and credentials by ID in the underlying Bosch IoT Suite services.
ProvisioningApi ServiceInstanceIdDevicesPost Post /{service-instance-id}/devices Provision a device: Creates the required resources in the underlying Bosch IoT Suite services.

Documentation For Models

Documentation For Authorization

SuiteAuth

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING")
r, err := client.Service.Operation(auth, args)

Or via OAuth2 module to automatically refresh tokens and perform user authentication.

import "golang.org/x/oauth2"

/* Perform OAuth2 round trip request and obtain a token */

tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token)
auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource)
r, err := client.Service.Operation(auth, args)

bearerAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Author

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	DeProvisioningApi *DeProvisioningApiService

	ProvisioningApi *ProvisioningApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Bosch IoT Suite - Device Provisioning API v1 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

ChangeBasePath changes base path to allow switching to mocks

func (*APIClient) GetConfig

func (c *APIClient) GetConfig() *Configuration

Allow modification of underlying config for alternate implementations and testing Caution: modifying the configuration while live can cause data races and potentially unwanted behavior

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the OpenAPI operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

APIResponse stores the API response returned by the server.

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

NewAPIResponse returns a new APIResonse object.

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse

NewAPIResponseWithError returns a new APIResponse object with the provided error message.

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	Debug         bool              `json:"debug,omitempty"`
	Servers       []ServerConfiguration
	HTTPClient    *http.Client
}

Configuration stores the configuration of the API client

func NewConfiguration

func NewConfiguration() *Configuration

NewConfiguration returns a new Configuration object

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

AddDefaultHeader adds a new HTTP header to the default header in the request

func (*Configuration) ServerUrl

func (c *Configuration) ServerUrl(index int, variables map[string]string) (string, error)

ServerUrl returns URL based on server settings

type CredentialSuite

type CredentialSuite struct {
	// The identity that the device should be authenticated as.
	AuthId string `json:"authId,omitempty"`
	// If set to false the credentials are not supposed to be used to authenticate devices any longer. This may e.g. be used to disable a particular mechanism for authenticating the device.
	Enabled bool `json:"enabled,omitempty"`
	// The ID of the device to which the credentials belong.
	DeviceId string `json:"deviceId,omitempty"`
	Type     string `json:"type"`
	// A list of secrets scoped to a particular time period. This array must contain at least one element - an empty array is handled as an error. Note: PSK is only supported in some protocol adapters. For details check the [Hub documentation](https://docs.bosch-iot-suite.com/hub/general-concepts/deviceauthentication.html)
	Secrets []OneOfsecretPsk `json:"secrets"`
}

CredentialSuite struct for CredentialSuite

type CredentialSuiteResponse

type CredentialSuiteResponse struct {
	// The identity that the device should be authenticated as.
	AuthId string `json:"authId,omitempty"`
	// If set to false the credentials are not supposed to be used to authenticate devices any longer. This may e.g. be used to disable a particular mechanism for authenticating the device.
	Enabled bool `json:"enabled,omitempty"`
	// The ID of the device to which the credentials belong.
	DeviceId string `json:"deviceId,omitempty"`
	Type     string `json:"type"`
	// A list of secrets scoped to a particular time period. This array must contain at least one element - an empty array is handled as an error. Note: PSK is only supported in some protocol adapters. For details check the [Hub documentation](https://docs.bosch-iot-suite.com/hub/general-concepts/deviceauthentication.html)
	Secrets []OneOfsecretPsk `json:"secrets"`
	// A list of protocol adapters that can be used with these credentials
	Adapters []CredentialSuiteResponseAllOfAdapters `json:"adapters,omitempty"`
}

CredentialSuiteResponse struct for CredentialSuiteResponse

type CredentialSuiteResponseAllOf

type CredentialSuiteResponseAllOf struct {
	// A list of protocol adapters that can be used with these credentials
	Adapters []CredentialSuiteResponseAllOfAdapters `json:"adapters,omitempty"`
}

CredentialSuiteResponseAllOf struct for CredentialSuiteResponseAllOf

type CredentialSuiteResponseAllOfAdapters

type CredentialSuiteResponseAllOfAdapters struct {
	// The protocol adapter type, e.g. http or mqtt
	Type string `json:"type,omitempty"`
	// The URI of the protocol adapter in the form of `scheme://host[:port]`
	Uri string `json:"uri,omitempty"`
	// The host of the protocol adapter
	Host string `json:"host,omitempty"`
	// The port of the protocol adapter
	Port int32 `json:"port,omitempty"`
}

CredentialSuiteResponseAllOfAdapters struct for CredentialSuiteResponseAllOfAdapters

type CredentialsBase

type CredentialsBase struct {
	// The identity that the device should be authenticated as.
	AuthId string `json:"authId,omitempty"`
	// If set to false the credentials are not supposed to be used to authenticate devices any longer. This may e.g. be used to disable a particular mechanism for authenticating the device.
	Enabled bool `json:"enabled,omitempty"`
	// The ID of the device to which the credentials belong.
	DeviceId string `json:"deviceId,omitempty"`
}

CredentialsBase struct for CredentialsBase

type DeProvisioningApiService

type DeProvisioningApiService service

DeProvisioningApiService DeProvisioningApi service

func (*DeProvisioningApiService) ServiceInstanceIdDevicesDeviceIdDelete

func (a *DeProvisioningApiService) ServiceInstanceIdDevicesDeviceIdDelete(ctx _context.Context, serviceInstanceId string, deviceId string, localVarOptionals *ServiceInstanceIdDevicesDeviceIdDeleteOpts) (DeprovisioningResponsePayload, *_nethttp.Response, error)

ServiceInstanceIdDevicesDeviceIdDelete De-provisioning a device: Deletes the device, thing, policy and credentials by ID in the underlying Bosch IoT Suite services.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param serviceInstanceId The ID of the Bosch IoT Suite for Asset Communication subscription for which you want to de-provision a device. Not the IDs of the underlying Bosch IoT Hub or Bosch IoT Things service instance.
  • @param deviceId The ID of the device you want to de-provision
  • @param optional nil or *ServiceInstanceIdDevicesDeviceIdDeleteOpts - Optional Parameters:
  • @param "KeepCredentials" (optional.Bool) - Pass 'true' if you wish to keep the device's credentials
  • @param "KeepPolicy" (optional.Bool) - Pass 'true' if you wish to keep the thing's policy

@return DeprovisioningResponsePayload

type DeprovisioningResponsePayload

type DeprovisioningResponsePayload struct {
	// A message describing the result of deleting the device resource.
	Device string `json:"device,omitempty"`
	// A message describing the result of deleting the credentials resource.
	Credentials string `json:"credentials,omitempty"`
	// A message describing the result of deleting the thing resource.
	Thing string `json:"thing,omitempty"`
	// A message describing the result of deleting the policy resource.
	Policy string `json:"policy,omitempty"`
}

DeprovisioningResponsePayload struct for DeprovisioningResponsePayload

type GenericOpenAPIError

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

GenericOpenAPIError Provides access to the body, error and model on returned errors.

func (GenericOpenAPIError) Body

func (e GenericOpenAPIError) Body() []byte

Body returns the raw bytes of the response

func (GenericOpenAPIError) Error

func (e GenericOpenAPIError) Error() string

Error returns non-empty string if there was an error.

func (GenericOpenAPIError) Model

func (e GenericOpenAPIError) Model() interface{}

Model returns the unpacked model of the error

type HashedPassword

type HashedPassword struct {
	// The identity that the device should be authenticated as.
	AuthId string `json:"authId,omitempty"`
	// If set to false the credentials are not supposed to be used to authenticate devices any longer. This may e.g. be used to disable a particular mechanism for authenticating the device.
	Enabled bool `json:"enabled,omitempty"`
	// The ID of the device to which the credentials belong.
	DeviceId string `json:"deviceId,omitempty"`
	Type     string `json:"type"`
	// A list of secrets scoped to a particular time period. This array must contain at least one element - an empty array is handled as an error.
	Secrets []OneOfsecretHashsecretPasswordsecretPasswordBase64 `json:"secrets"`
}

HashedPassword struct for HashedPassword

type HashedPasswordAllOf

type HashedPasswordAllOf struct {
	Type string `json:"type"`
	// A list of secrets scoped to a particular time period. This array must contain at least one element - an empty array is handled as an error.
	Secrets []OneOfsecretHashsecretPasswordsecretPasswordBase64 `json:"secrets"`
}

HashedPasswordAllOf struct for HashedPasswordAllOf

type HubResources

type HubResources struct {
	Device      RegistrationSuite `json:"device"`
	Credentials CredentialSuite   `json:"credentials,omitempty"`
}

HubResources Data structure holding provisioning information for Bosch IoT Hub.

type HubResponse

type HubResponse struct {
	Device      RegistrationSuite       `json:"device,omitempty"`
	Credentials CredentialSuiteResponse `json:"credentials,omitempty"`
}

HubResponse struct for HubResponse

type Provisioning400ErrorPayload

type Provisioning400ErrorPayload struct {
	// A message describing the cause.
	Description string `json:"description,omitempty"`
	// An arbitrary JSON object representing the error.
	ErrorDetails map[string]interface{} `json:"errorDetails,omitempty"`
}

Provisioning400ErrorPayload struct for Provisioning400ErrorPayload

type ProvisioningApiService

type ProvisioningApiService service

ProvisioningApiService ProvisioningApi service

func (*ProvisioningApiService) ServiceInstanceIdDevicesPost

func (a *ProvisioningApiService) ServiceInstanceIdDevicesPost(ctx _context.Context, serviceInstanceId string, localVarOptionals *ServiceInstanceIdDevicesPostOpts) (ProvisioningResponsePayload, *_nethttp.Response, error)

ServiceInstanceIdDevicesPost Provision a device: Creates the required resources in the underlying Bosch IoT Suite services.

  • @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
  • @param serviceInstanceId The ID of the Bosch IoT Suite for Asset Communication subscription for which you want to provision a device. Not the IDs of the underlying Bosch IoT Hub or Bosch IoT Things service instance.
  • @param optional nil or *ServiceInstanceIdDevicesPostOpts - Optional Parameters:
  • @param "AuthScope" (optional.String) - Controls who owns the newly created Thing (i.e. which subject is used for the default entry of the created Policy). If this parameter is omitted the authenticated subject of the user who made the request is used (Things default). Supported scopes: * `subscription`: full access is granted to all users who have access to the same IoT Suite subscription
  • @param "SkipVorto" (optional.Bool) - If set to true, the resolution of the Vorto model from the definition field of the Thing will not be attempted.
  • @param "ProvisioningRequestPayload" (optional.Interface of ProvisioningRequestPayload) -

@return ProvisioningResponsePayload

type ProvisioningRequestPayload

type ProvisioningRequestPayload struct {
	Id     string          `json:"id"`
	Hub    HubResources    `json:"hub"`
	Things ThingsResources `json:"things"`
}

ProvisioningRequestPayload Defines the structure of a provisioning request.

type ProvisioningResponsePayload

type ProvisioningResponsePayload struct {
	Id     string          `json:"id,omitempty"`
	Hub    HubResponse     `json:"hub,omitempty"`
	Things ThingsResources `json:"things,omitempty"`
}

ProvisioningResponsePayload Defines the structure of a provisioning response.

type Psk

type Psk struct {
	// The identity that the device should be authenticated as.
	AuthId string `json:"authId,omitempty"`
	// If set to false the credentials are not supposed to be used to authenticate devices any longer. This may e.g. be used to disable a particular mechanism for authenticating the device.
	Enabled bool `json:"enabled,omitempty"`
	// The ID of the device to which the credentials belong.
	DeviceId string `json:"deviceId,omitempty"`
	Type     string `json:"type"`
	// A list of secrets scoped to a particular time period. This array must contain at least one element - an empty array is handled as an error. Note: PSK is only supported in some protocol adapters. For details check the [Hub documentation](https://docs.bosch-iot-suite.com/hub/general-concepts/deviceauthentication.html)
	Secrets []OneOfsecretPsk `json:"secrets"`
}

Psk struct for Psk

type PskAllOf

type PskAllOf struct {
	Type string `json:"type"`
	// A list of secrets scoped to a particular time period. This array must contain at least one element - an empty array is handled as an error. Note: PSK is only supported in some protocol adapters. For details check the [Hub documentation](https://docs.bosch-iot-suite.com/hub/general-concepts/deviceauthentication.html)
	Secrets []OneOfsecretPsk `json:"secrets"`
}

PskAllOf struct for PskAllOf

type RegistrationSuite

type RegistrationSuite struct {
	DeviceId string `json:"deviceId,omitempty"`
	Enabled  bool   `json:"enabled,omitempty"`
	// Gateway Device that is allowed to send messages on behalf of the device.
	Via      string                    `json:"via,omitempty"`
	Defaults RegistrationSuiteDefaults `json:"defaults,omitempty"`
}

RegistrationSuite struct for RegistrationSuite

type RegistrationSuiteDefaults

type RegistrationSuiteDefaults struct {
	// The content-type to use for northbound messages published by this device. This can be useful for protocols like MQTT where the content-type cannot be set directly in a message. The content-type is specified in RFC-2046. Example value: 'application/json'
	ContentType string `json:"content-type,omitempty"`
	// The content-encoding can be set optionally in addition to the content-type. It defines what additional content encodings have to be applied to the message content to receive the media-type referenced by the content-type. The main usage of the content-encoding is to allow compression without losing information about the compressed data type. The content-encoding is specified in section 3.5 of RFC 2616.
	ContentEncoding string `json:"content-encoding,omitempty"`
	// The time-to-live (in seconds) to use for events published by this device. This value is limited by the booked service plan's event storage time.
	Ttl int32 `json:"ttl,omitempty"`
}

RegistrationSuiteDefaults Default values to be used by protocol adapters for augmenting messages from devices with missing information like a content-type. It is up to the discretion of a protocol adapter if and how to use the given default values when processing messages published by the device. It is possible to add custom properties, these will be added to each message as application properties.

type SecretCertificate

type SecretCertificate struct {
	// The point in time from which the secret may be used to authenticate devices. This is optional and can be ignored if the validity period is the same as the period indicated by the client certificate’s corresponding properties. If not null, the value MUST be an ISO 8601 compliant combined date and time representation.
	NotBefore string `json:"notBefore,omitempty"`
	// The point in time until which the secret may be used to authenticate devices. This is optional and can be ignored if the validity period is the same as the period indicated by the client certificate’s corresponding properties. If not null, the value MUST be an ISO 8601 compliant combined date and time representation.
	NotAfter string `json:"notAfter,omitempty"`
}

SecretCertificate Data structure representing a certificate credential.

type SecretHash

type SecretHash struct {
	// The point in time from which the secret may be used to authenticate devices. This is optional and can be ignored if the validity period is the same as the period indicated by the client certificate’s corresponding properties. If not null, the value MUST be an ISO 8601 compliant combined date and time representation.
	NotBefore string `json:"notBefore,omitempty"`
	// The point in time until which the secret may be used to authenticate devices. This is optional and can be ignored if the validity period is the same as the period indicated by the client certificate’s corresponding properties. If not null, the value MUST be an ISO 8601 compliant combined date and time representation.
	NotAfter string `json:"notAfter,omitempty"`
	// __DEPRECATED!__ The Base64 encoded bytes representing the hashed password. The password hash MUST be computed by applying the hash function to the byte array consisting of the salt bytes (if a salt is used) and the UTF-8 encoding of the clear text password.
	PwdHash string `json:"pwdHash"`
	// __DEPRECATED!__ The Base64 encoded bytes used as salt for the password hash. If not set then the password hash has been created without salt.
	Salt string `json:"salt,omitempty"`
	// __DEPRECATED!__ The name of the hash function used to create the password hash. At the moment sha-256 and sha-512 are supported.
	HashFunction string `json:"hashFunction"`
}

SecretHash __DEPRECATED!__ Data structure representing a hashed secret of a credential. Please use plaintext secret or base64 encoded plaintext secret.

type SecretPassword

type SecretPassword struct {
	// The point in time from which the secret may be used to authenticate devices. This is optional and can be ignored if the validity period is the same as the period indicated by the client certificate’s corresponding properties. If not null, the value MUST be an ISO 8601 compliant combined date and time representation.
	NotBefore string `json:"notBefore,omitempty"`
	// The point in time until which the secret may be used to authenticate devices. This is optional and can be ignored if the validity period is the same as the period indicated by the client certificate’s corresponding properties. If not null, the value MUST be an ISO 8601 compliant combined date and time representation.
	NotAfter string `json:"notAfter,omitempty"`
	// Plaintext password. Will be salted and hashed by Bosch IoT Hub.
	Password string `json:"password"`
}

SecretPassword Data structure representing a plaintext secret of a credential.

type SecretPasswordBase64

type SecretPasswordBase64 struct {
	// The point in time from which the secret may be used to authenticate devices. This is optional and can be ignored if the validity period is the same as the period indicated by the client certificate’s corresponding properties. If not null, the value MUST be an ISO 8601 compliant combined date and time representation.
	NotBefore string `json:"notBefore,omitempty"`
	// The point in time until which the secret may be used to authenticate devices. This is optional and can be ignored if the validity period is the same as the period indicated by the client certificate’s corresponding properties. If not null, the value MUST be an ISO 8601 compliant combined date and time representation.
	NotAfter string `json:"notAfter,omitempty"`
	// Plaintext base64 encoded password. Will be salted and hashed by Bosch IoT Hub.
	PasswordBase64 string `json:"passwordBase64"`
}

SecretPasswordBase64 Data structure representing a base64 encoded plaintext secret of a credential.

type SecretPsk

type SecretPsk struct {
	// The point in time from which the secret may be used to authenticate devices. This is optional and can be ignored if the validity period is the same as the period indicated by the client certificate’s corresponding properties. If not null, the value MUST be an ISO 8601 compliant combined date and time representation.
	NotBefore string `json:"notBefore,omitempty"`
	// The point in time until which the secret may be used to authenticate devices. This is optional and can be ignored if the validity period is the same as the period indicated by the client certificate’s corresponding properties. If not null, the value MUST be an ISO 8601 compliant combined date and time representation.
	NotAfter string `json:"notAfter,omitempty"`
	// The Base64 encoded bytes representing the shared (secret) key.
	Key string `json:"key"`
}

SecretPsk Data structure representing a pre-shared key credential.

type ServerConfiguration

type ServerConfiguration struct {
	Url         string
	Description string
	Variables   map[string]ServerVariable
}

ServerConfiguration stores the information about a server

type ServerVariable

type ServerVariable struct {
	Description  string
	DefaultValue string
	EnumValues   []string
}

ServerVariable stores the information about a server variable

type ServiceInstanceIdDevicesDeviceIdDeleteOpts

type ServiceInstanceIdDevicesDeviceIdDeleteOpts struct {
	KeepCredentials optional.Bool
	KeepPolicy      optional.Bool
}

ServiceInstanceIdDevicesDeviceIdDeleteOpts Optional parameters for the method 'ServiceInstanceIdDevicesDeviceIdDelete'

type ServiceInstanceIdDevicesPostOpts

type ServiceInstanceIdDevicesPostOpts struct {
	AuthScope                  optional.String
	SkipVorto                  optional.Bool
	ProvisioningRequestPayload optional.Interface
}

ServiceInstanceIdDevicesPostOpts Optional parameters for the method 'ServiceInstanceIdDevicesPost'

type ThingsResources

type ThingsResources struct {
	// Data structure for creating a Thing in Bosch IoT Things. For details, see `Create a new Thing` at the [Bosch IoT Things Http API Documentation](https://apidocs.bosch-iot-suite.com/index.html?urls.primaryName=Bosch%20IoT%20Things%20-%20API%20v2). Note that in contrast to direct usage of the Things API, the `id` will not be generated, but will be set to the one specified in the request's ProvisioningRequestPayload. If set, it must match the one from the request's ProvisioningRequestPayload. Note that a Vorto model can be used to to define the capabilities of a Thing. To include the capabilities of a Vorto model, the fully qualified name (in the form namespace:name:version) of the model must be set in the 'definition' field of the Thing. The model is then retrieved from the official Eclipse Vorto repository and its capabilities are automatically added to the Thing. Note that each Thing requires a Policy which defines its access control. You can specify the Policy for a Thing in three different ways:  * use a generated Policy (recommended): per default, the Device Provisioning Service creates a Policy for  you (which covers standard usage scenarios)  * use an existing Policy: specify `policyId` appropriately  * define your own Policy: define the Policy as an Inline-Policy (field `_policy`)  The generated Policy contains two entries:  * `DEFAULT`: Defines access for the Provisioner (the one who provisions the device with this API). It  provides full `READ` and `WRITE` access to the Thing, Messages and the Policy itself.  * `DEVICE`: Defines access control for the connectivity of the device. It provides full `READ` and `WRITE`  access to the Thing and Messages, but not to the Policy itself.  “` {   \"policyId\": \"<<provisioningRequestPayload.id>>\",   \"entries\": {       \"DEFAULT\": {         \"subjects\": {           \"{{ request:subjectId }}\": { \"type\": \"suite-auth\" }         },         \"resources\": {           \"thing:/\":   { \"grant\": [\"READ\", \"WRITE\"], \"revoke\": [] },           \"message:/\": { \"grant\": [\"READ\", \"WRITE\"], \"revoke\": [] },           \"policy:/\":  { \"grant\": [\"READ\", \"WRITE\"], \"revoke\": [] }         }       },       \"DEVICE\": {         \"subjects\": {           \"integration:{{ request:solutionId }}:hub\": {             \"type\": \"iot-things-integration\"           }         },         \"resources\": {           \"thing:/\":   { \"grant\": [\"READ\", \"WRITE\"], \"revoke\": [] },           \"message:/\": { \"grant\": [\"READ\", \"WRITE\"], \"revoke\": [] }         }       }   } } “`
	Thing map[string]interface{} `json:"thing"`
}

ThingsResources Data structure holding provisioning information for Bosch IoT Things.

type X509Cert

type X509Cert struct {
	// The identity that the device should be authenticated as.
	AuthId string `json:"authId,omitempty"`
	// If set to false the credentials are not supposed to be used to authenticate devices any longer. This may e.g. be used to disable a particular mechanism for authenticating the device.
	Enabled bool `json:"enabled,omitempty"`
	// The ID of the device to which the credentials belong.
	DeviceId string `json:"deviceId,omitempty"`
	Type     string `json:"type"`
	// A list of secrets scoped to a particular time period.
	Secrets []OneOfsecretCertificate `json:"secrets"`
}

X509Cert struct for X509Cert

type X509CertAllOf

type X509CertAllOf struct {
	Type string `json:"type"`
	// A list of secrets scoped to a particular time period.
	Secrets []OneOfsecretCertificate `json:"secrets"`
}

X509CertAllOf struct for X509CertAllOf

Jump to

Keyboard shortcuts

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