Cloud2Cloud Connector

7 minutes read
Edit on GitHub

C2C Connector connects to other hub implementing the Open Connectivity Foundation’s Cloud API for Cloud Services and mirror devices from this linked instance to yours.

SOURCE Copy
Copied
        docker pull ghcr.io/plgd-dev/hub/cloud2cloud-connector:latest
    

A configuration template is available in cloud2cloud-connector/config.yaml

PropertyTypeDescriptionDefault
log.levelstringLogging enabled from level."info"
log.encodingstringLogging format. The supported values are: "json", "console""json"
log.stacktrace.enabledboolLog stacktrace.false
log.stacktrace.levelstringStacktrace from level."warn"
log.encoderConfig.timeEncoderstringTime format for logs. The supported values are: "rfc3339nano", "rfc3339"."rfc3339nano"
PropertyTypeDescriptionDefault
apis.http.addressstringListen specification <host>:<port> for http client connection."0.0.0.0:9100"
apis.http.readTimeoutstringThe maximum duration for reading the entire request, including the body by the server. A zero or negative value means there will be no timeout.8s
apis.http.readHeaderTimeoutstringThe amount of time allowed to read request headers by the server. If readHeaderTimeout is zero, the value of readTimeout is used. If both are zero, there is no timeout.4s
apis.http.writeTimeoutstringThe maximum duration before the server times out writing of the response. A zero or negative value means there will be no timeout.16s
apis.http.idleTimeoutstringThe maximum amount of time the server waits for the next request when keep-alives are enabled. If idleTimeout is zero, the value of readTimeout is used. If both are zero, there is no timeout.30s
apis.http.tls.caPool[]stringFile paths to the root certificates in PEM format. The file may contain multiple certificates.[]
apis.http.tls.keyFilestringFile path to private key in PEM format.""
apis.http.tls.certFilestringFile path to certificate in PEM format.""
apis.http.tls.clientCertificateRequiredboolIf true, require client certificate.true
apis.http.eventsURLstringExternal url where the events from another hub will be send""
apis.http.pullDevices.disabledboolDisable get devices via pull for all cloudstrue
apis.http.pullDevices.intervalstring"Time interval between pulls"5s"
apis.http.clientIDstringClient ID to exchange an authorization code for an access token.""
apis.http.clientSecretFilestringFile path to client secret required to exchange an authorization code for an access token.""
apis.http.scopesstring arrayList of required scopes.""
apis.http.authorization.authoritystringAuthority is the address of the token-issuing authentication server. Services will use this URI to find and retrieve the public key that can be used to validate the token’s signature.""
apis.http.authorization.audiencestringIdentifier of the API configured in your OAuth provider.""
apis.http.authorization.ownerClaimstringClaim used to identify owner of the device."sub"
apis.http.authorization.redirectURLstringExternal redirect url to acquire authorization code.""
apis.http.authorization.http.maxIdleConnsintIt controls the maximum number of idle (keep-alive) connections across all hosts. Zero means no limit.16
apis.http.authorization.http.maxConnsPerHostintIt optionally limits the total number of connections per host, including connections in the dialing, active, and idle states. On limit violation, dials will block. Zero means no limit.32
apis.http.authorization.http.maxIdleConnsPerHostintIf non-zero, controls the maximum idle (keep-alive) connections to keep per-host. If zero, DefaultMaxIdleConnsPerHost is used.16
apis.http.authorization.http.idleConnTimeoutstringThe maximum amount of time an idle (keep-alive) connection will remain idle before closing itself. Zero means no limit.30s
apis.http.authorization.http.timeoutstringA time limit for requests made by this Client. A Timeout of zero means no timeout.10s
apis.http.authorization.http.tls.caPool[]stringFile paths to the root certificates in PEM format. The file may contain multiple certificates.[]
apis.http.authorization.http.tls.keyFilestringFile path to private key in PEM format.""
apis.http.authorization.http.tls.certFilestringFile path to certificate in PEM format.""
apis.http.authorization.http.tls.useSystemCAPoolboolIf true, use system certification pool.false
Tip

You might have one client, but multiple APIs in the OAuth system. What you want to prevent is to be able to contact all the APIs of your system with one token. This audience allows you to request the token for a specific API. If you configure it to myplgdc2c.api in the Auth0, you have to set it here if you want to also validate it.

Client configurations to internally connect to Identity Store service.

PropertyTypeDescriptionDefault
clients.identityStore.grpc.addressstringIdentity Store service address."127.0.0.1:9100"
clients.identityStore.grpc.tls.caPool[]stringFile paths to the root certificates in PEM format. The file may contain multiple certificates.[]
clients.identityStore.grpc.tls.keyFilestringFile path to private key in PEM format.""
clients.identityStore.grpc.tls.certFilestringFile path to certificate in PEM format.""
clients.identityStore.grpc.tls.useSystemCAPoolboolIf true, use system certification pool.false
clients.identityStore.grpc.keepAlive.timestringAfter a duration of this time if the client doesn't see any activity it pings the server to see if the transport is still alive.10s
clients.identityStore.grpc.keepAlive.timeoutstringAfter having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.20s
clients.identityStore.grpc.keepAlive.permitWithoutStreamboolIf true, client sends keepalive pings even with no active RPCs. If false, when there are no active RPCs, Time and Timeout will be ignored and no keepalive pings will be sent.false

plgd hub uses NATS messaging system as an event bus.

PropertyTypeDescriptionDefault
clients.eventBus.nats.urlstringURL to nats messaging system."nats://localhost:4222"
clients.eventBus.nats.pendingLimits.msgLimitintLimit number of messages in queue. -1 means unlimited524288
clients.eventBus.nats.pendingLimits.bytesLimitintLimit buffer size of queue. -1 means unlimited67108864
clients.eventBus.nats.tls.caPool[]stringFile paths to the root certificates in PEM format. The file may contain multiple certificates.[]
clients.eventBus.nats.tls.keyFilestringFile name of private key in PEM format.""
clients.eventBus.nats.tls.certFilestringFile name of certificate in PEM format.""
clients.eventBus.nats.tls.useSystemCAPoolboolIf true, use system certification pool.false
clients.eventBus.nats.leadResourceType.enabledboolIf true, subscribe to NATS with lead resource type subject token included.false

Client configurations to internally connect to GRPC Gateway service.

PropertyTypeDescriptionDefault
clients.grpcGateway.grpc.addressstringGRPC Gateway service address."127.0.0.1:9100"
clients.grpcGateway.grpc.tls.caPool[]stringFile paths to the root certificates in PEM format. The file may contain multiple certificates.[]
clients.grpcGateway.grpc.tls.keyFilestringFile path to private key in PEM format.""
clients.grpcGateway.grpc.tls.certFilestringFile path to certificate in PEM format.""
clients.grpcGateway.grpc.tls.useSystemCAPoolboolIf true, use system certification pool.false
clients.grpcGateway.grpc.keepAlive.timestringAfter a duration of this time if the client doesn't see any activity it pings the server to see if the transport is still alive.10s
clients.grpcGateway.grpc.keepAlive.timeoutstringAfter having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.20s
clients.grpcGateway.grpc.keepAlive.permitWithoutStreamboolIf true, client sends keepalive pings even with no active RPCs. If false, when there are no active RPCs, Time and Timeout will be ignored and no keepalive pings will be sent.false

Client configurations to internally connect to the Resource Aggregate service.

PropertyTypeDescriptionDefault
clients.resourceAggregate.grpc.addressstringResource aggregate service address."127.0.0.1:9100"
clients.resourceAggregate.grpc.keepAlive.timestringAfter a duration of this time if the client doesn't see any activity it pings the server to see if the transport is still alive.10s
clients.resourceAggregate.grpc.keepAlive.timeoutstringAfter having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.20s
clients.resourceAggregate.grpc.keepAlive.permitWithoutStreamboolIf true, client sends keepalive pings even with no active RPCs. If false, when there are no active RPCs, Time and Timeout will be ignored and no keepalive pings will be sent.false
clients.resourceAggregate.grpc.tls.caPool[]stringFile paths to the root certificates in PEM format. The file may contain multiple certificates.[]
clients.resourceAggregate.grpc.tls.keyFilestringFile path to private key in PEM format.""
clients.resourceAggregate.grpc.tls.certFilestringFile path to certificate in PEM format.""
clients.resourceAggregate.grpc.tls.useSystemCAPoolboolIf true, use system certification pool.false

The plgd open telemetry exporter configuration.

PropertyTypeDescriptionDefault
clients.openTelemetryCollector.grpc.enabledboolEnable OTLP gRPC exporterfalse
clients.openTelemetryCollector.grpc.addressstringThe gRPC collector to which the exporter is going to send data""
clients.openTelemetryCollector.grpc.keepAlive.timestringAfter a duration of this time if the client doesn't see any activity it pings the server to see if the transport is still alive.10s
clients.openTelemetryCollector.grpc.keepAlive.timeoutstringAfter having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed.20s
clients.openTelemetryCollector.grpc.keepAlive.permitWithoutStreamboolIf true, client sends keepalive pings even with no active RPCs. If false, when there are no active RPCs, Time and Timeout will be ignored and no keepalive pings will be sent.true
clients.openTelemetryCollector.grpc.tls.caPoolstringFile path to the root certificate in PEM format which might contain multiple certificates in a single file.""
clients.openTelemetryCollector.grpc.tls.keyFilestringFile path to private key in PEM format.""
clients.openTelemetryCollector.grpc.tls.certFilestringFile path to certificate in PEM format.""
clients.openTelemetryCollector.grpc.tls.useSystemCAPoolboolIf true, use system certification pool.false

plgd hub uses MongoDB database as the owner’s device store.

PropertyTypeDescriptionDefault
clients.storage.mongoDB.uristringURI to mongo database."mongodb://localhost:27017"
clients.storage.mongoDB.databasestringName of database."cloud2cloudConnector"
clients.storage.mongoDB.maxPoolSizeintLimits number of connections.16
clients.storage.mongoDB.maxConnIdleTimestringClose connection when idle time reach the value.4m
clients.storage.mongoDB.tls.caPool[]stringFile paths to the root certificates in PEM format. The file may contain multiple certificates.[]
clients.storage.mongoDB.tls.keyFilestringFile path to private key in PEM format.""
clients.storage.mongoDB.tls.certFilestringFile path to certificate in PEM format.""
clients.storage.mongoDB.tls.useSystemCAPoolboolIf true, use system certification pool.false
PropertyTypeDescriptionDefault
clients.subscription.http.reconnectIntervalstringThe interval after which to try to reconnect to grpc-gateway client when connection was closed."10s"
clients.subscription.http.resubscribeIntervalstringThe interval after which to try to resubscribe to grpc-gateway client when subscription does not exist."10s"
PropertyTypeDescriptionDefault
taskProcessor.cacheSizeintSize of processor task queue2048
taskProcessor.timeoutstringTimeout for one running task"5s"
taskProcessor.maxParallelintMaximal number of running tasks at the same time128
taskProcessor.delaystringTask delay before start0s

Follow OCF Cloud API For Cloud Services Specification

  • maintenance of linked clouds
  • maintenance of linked accounts
  • swagger
Oct 1, 2021

Get started

plgd makes it simpler to build a successful IoT initiative – to create a proof of concept, evaluate, optimize, and scale.

Get Started Illustration Get Started Illustration