Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
fix: changes to retry logic
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored and bcoe committed Oct 15, 2019
1 parent f5714d4 commit 68a1d6e
Show file tree
Hide file tree
Showing 10 changed files with 1,867 additions and 1,046 deletions.
265 changes: 177 additions & 88 deletions protos/google/cloud/iot/v1/device_manager.proto

Large diffs are not rendered by default.

266 changes: 138 additions & 128 deletions protos/google/cloud/iot/v1/resources.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2018 Google LLC.
// Copyright 2019 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,7 +17,7 @@ syntax = "proto3";

package google.cloud.iot.v1;

import "google/api/annotations.proto";
import "google/api/resource.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";

Expand All @@ -29,6 +29,11 @@ option java_package = "com.google.cloud.iot.v1";

// The device resource.
message Device {
option (google.api.resource) = {
type: "cloudiot.googleapis.com/Device"
pattern: "projects/{project}/locations/{location}/registries/{registry}/devices/{device}"
};

// The user-defined device identifier. The device ID must be unique
// within a device registry.
string id = 1;
Expand Down Expand Up @@ -149,6 +154,11 @@ message GatewayConfig {

// A container for a group of devices.
message DeviceRegistry {
option (google.api.resource) = {
type: "cloudiot.googleapis.com/DeviceRegistry"
pattern: "projects/{project}/locations/{location}/registries/{registry}"
};

// The identifier of this device registry. For example, `myRegistry`.
string id = 1;

Expand Down Expand Up @@ -208,13 +218,97 @@ message MqttConfig {
MqttState mqtt_enabled_state = 1;
}

// Indicates whether an MQTT connection is enabled or disabled. See the field
// description for details.
enum MqttState {
// No MQTT state specified. If not specified, MQTT will be enabled by default.
MQTT_STATE_UNSPECIFIED = 0;

// Enables a MQTT connection.
MQTT_ENABLED = 1;

// Disables a MQTT connection.
MQTT_DISABLED = 2;
}

// The configuration of the HTTP bridge for a device registry.
message HttpConfig {
// If enabled, allows devices to use DeviceService via the HTTP protocol.
// Otherwise, any requests to DeviceService will fail for this registry.
HttpState http_enabled_state = 1;
}

// Indicates whether DeviceService (HTTP) is enabled or disabled for the
// registry. See the field description for details.
enum HttpState {
// No HTTP state specified. If not specified, DeviceService will be
// enabled by default.
HTTP_STATE_UNSPECIFIED = 0;

// Enables DeviceService (HTTP) service for the registry.
HTTP_ENABLED = 1;

// Disables DeviceService (HTTP) service for the registry.
HTTP_DISABLED = 2;
}

// **Beta Feature**
//
// The logging verbosity for device activity. Specifies which events should be
// written to logs. For example, if the LogLevel is ERROR, only events that
// terminate in errors will be logged. LogLevel is inclusive; enabling INFO
// logging will also enable ERROR logging.
enum LogLevel {
// No logging specified. If not specified, logging will be disabled.
LOG_LEVEL_UNSPECIFIED = 0;

// Disables logging.
NONE = 10;

// Error events will be logged.
ERROR = 20;

// Informational events will be logged, such as connections and
// disconnections.
INFO = 30;

// All events will be logged.
DEBUG = 40;
}

// Gateway type.
enum GatewayType {
// If unspecified, the device is considered a non-gateway device.
GATEWAY_TYPE_UNSPECIFIED = 0;

// The device is a gateway.
GATEWAY = 1;

// The device is not a gateway.
NON_GATEWAY = 2;
}

// The gateway authorization/authentication method. This setting determines how
// Cloud IoT Core authorizes/authenticate devices to access the gateway.
enum GatewayAuthMethod {
// No authentication/authorization method specified. No devices are allowed to
// access the gateway.
GATEWAY_AUTH_METHOD_UNSPECIFIED = 0;

// The device is authenticated through the gateway association only. Device
// credentials are ignored even if provided.
ASSOCIATION_ONLY = 1;

// The device is authenticated through its own credentials. Gateway
// association is not checked.
DEVICE_AUTH_TOKEN_ONLY = 2;

// The device is authenticated through both device credentials and gateway
// association. The device must be bound to the gateway and must provide its
// own credentials.
ASSOCIATION_AND_DEVICE_AUTH_TOKEN = 3;
}

// The configuration for forwarding telemetry events.
message EventNotificationConfig {
// If the subfolder name matches this string exactly, this configuration will
Expand Down Expand Up @@ -277,6 +371,18 @@ message PublicKeyCertificate {
X509CertificateDetails x509_details = 3;
}

// The supported formats for the public key.
enum PublicKeyCertificateFormat {
// The format has not been specified. This is an invalid default value and
// must not be used.
UNSPECIFIED_PUBLIC_KEY_CERTIFICATE_FORMAT = 0;

// An X.509v3 certificate ([RFC5280](https://www.ietf.org/rfc/rfc5280.txt)),
// encoded in base64, and wrapped by `-----BEGIN CERTIFICATE-----` and
// `-----END CERTIFICATE-----`.
X509_CERTIFICATE_PEM = 1;
}

// A server-stored device credential used for authentication.
message DeviceCredential {
// The credential data. Reserved for expansion in the future.
Expand Down Expand Up @@ -310,6 +416,36 @@ message PublicKeyCredential {
string key = 2;
}

// The supported formats for the public key.
enum PublicKeyFormat {
// The format has not been specified. This is an invalid default value and
// must not be used.
UNSPECIFIED_PUBLIC_KEY_FORMAT = 0;

// An RSA public key encoded in base64, and wrapped by
// `-----BEGIN PUBLIC KEY-----` and `-----END PUBLIC KEY-----`. This can be
// used to verify `RS256` signatures in JWT tokens ([RFC7518](
// https://www.ietf.org/rfc/rfc7518.txt)).
RSA_PEM = 3;

// As RSA_PEM, but wrapped in an X.509v3 certificate ([RFC5280](
// https://www.ietf.org/rfc/rfc5280.txt)), encoded in base64, and wrapped by
// `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`.
RSA_X509_PEM = 1;

// Public key for the ECDSA algorithm using P-256 and SHA-256, encoded in
// base64, and wrapped by `-----BEGIN PUBLIC KEY-----` and `-----END
// PUBLIC KEY-----`. This can be used to verify JWT tokens with the `ES256`
// algorithm ([RFC7518](https://www.ietf.org/rfc/rfc7518.txt)). This curve is
// defined in [OpenSSL](https://www.openssl.org/) as the `prime256v1` curve.
ES256_PEM = 2;

// As ES256_PEM, but wrapped in an X.509v3 certificate ([RFC5280](
// https://www.ietf.org/rfc/rfc5280.txt)), encoded in base64, and wrapped by
// `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`.
ES256_X509_PEM = 4;
}

// The device configuration. Eventually delivered to devices.
message DeviceConfig {
// [Output only] The version of this update. The version number is assigned by
Expand Down Expand Up @@ -346,129 +482,3 @@ message DeviceState {
// The device state data.
bytes binary_data = 2;
}

// Indicates whether an MQTT connection is enabled or disabled. See the field
// description for details.
enum MqttState {
// No MQTT state specified. If not specified, MQTT will be enabled by default.
MQTT_STATE_UNSPECIFIED = 0;

// Enables a MQTT connection.
MQTT_ENABLED = 1;

// Disables a MQTT connection.
MQTT_DISABLED = 2;
}

// Indicates whether DeviceService (HTTP) is enabled or disabled for the
// registry. See the field description for details.
enum HttpState {
// No HTTP state specified. If not specified, DeviceService will be
// enabled by default.
HTTP_STATE_UNSPECIFIED = 0;

// Enables DeviceService (HTTP) service for the registry.
HTTP_ENABLED = 1;

// Disables DeviceService (HTTP) service for the registry.
HTTP_DISABLED = 2;
}

// **Beta Feature**
//
// The logging verbosity for device activity. Specifies which events should be
// written to logs. For example, if the LogLevel is ERROR, only events that
// terminate in errors will be logged. LogLevel is inclusive; enabling INFO
// logging will also enable ERROR logging.
enum LogLevel {
// No logging specified. If not specified, logging will be disabled.
LOG_LEVEL_UNSPECIFIED = 0;

// Disables logging.
NONE = 10;

// Error events will be logged.
ERROR = 20;

// Informational events will be logged, such as connections and
// disconnections.
INFO = 30;

// All events will be logged.
DEBUG = 40;
}

// Gateway type.
enum GatewayType {
// If unspecified, the device is considered a non-gateway device.
GATEWAY_TYPE_UNSPECIFIED = 0;

// The device is a gateway.
GATEWAY = 1;

// The device is not a gateway.
NON_GATEWAY = 2;
}

// The gateway authorization/authentication method. This setting determines how
// Cloud IoT Core authorizes/authenticate devices to access the gateway.
enum GatewayAuthMethod {
// No authentication/authorization method specified. No devices are allowed to
// access the gateway.
GATEWAY_AUTH_METHOD_UNSPECIFIED = 0;

// The device is authenticated through the gateway association only. Device
// credentials are ignored even if provided.
ASSOCIATION_ONLY = 1;

// The device is authenticated through its own credentials. Gateway
// association is not checked.
DEVICE_AUTH_TOKEN_ONLY = 2;

// The device is authenticated through both device credentials and gateway
// association. The device must be bound to the gateway and must provide its
// own credentials.
ASSOCIATION_AND_DEVICE_AUTH_TOKEN = 3;
}

// The supported formats for the public key.
enum PublicKeyCertificateFormat {
// The format has not been specified. This is an invalid default value and
// must not be used.
UNSPECIFIED_PUBLIC_KEY_CERTIFICATE_FORMAT = 0;

// An X.509v3 certificate ([RFC5280](https://www.ietf.org/rfc/rfc5280.txt)),
// encoded in base64, and wrapped by `-----BEGIN CERTIFICATE-----` and
// `-----END CERTIFICATE-----`.
X509_CERTIFICATE_PEM = 1;
}

// The supported formats for the public key.
enum PublicKeyFormat {
// The format has not been specified. This is an invalid default value and
// must not be used.
UNSPECIFIED_PUBLIC_KEY_FORMAT = 0;

// An RSA public key encoded in base64, and wrapped by
// `-----BEGIN PUBLIC KEY-----` and `-----END PUBLIC KEY-----`. This can be
// used to verify `RS256` signatures in JWT tokens ([RFC7518](
// https://www.ietf.org/rfc/rfc7518.txt)).
RSA_PEM = 3;

// As RSA_PEM, but wrapped in an X.509v3 certificate ([RFC5280](
// https://www.ietf.org/rfc/rfc5280.txt)), encoded in base64, and wrapped by
// `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`.
RSA_X509_PEM = 1;

// Public key for the ECDSA algorithm using P-256 and SHA-256, encoded in
// base64, and wrapped by `-----BEGIN PUBLIC KEY-----` and `-----END
// PUBLIC KEY-----`. This can be used to verify JWT tokens with the `ES256`
// algorithm ([RFC7518](https://www.ietf.org/rfc/rfc7518.txt)). This curve is
// defined in [OpenSSL](https://www.openssl.org/) as the `prime256v1` curve.
ES256_PEM = 2;

// As ES256_PEM, but wrapped in an X.509v3 certificate ([RFC5280](
// https://www.ietf.org/rfc/rfc5280.txt)), encoded in base64, and wrapped by
// `-----BEGIN CERTIFICATE-----` and `-----END CERTIFICATE-----`.
ES256_X509_PEM = 4;
}
Loading

0 comments on commit 68a1d6e

Please sign in to comment.