uri

package
v2.17.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DeviceIDKey      = "deviceId"
	ResourceHrefKey  = "resourceHref"
	CorrelationIDKey = "correlationId"

	ResourceInterfaceQueryKey    = "resourceInterface"
	TwinQueryKey                 = "twin"
	CommandFilterQueryKey        = "commandFilter"
	TypeFilterQueryKey           = "typeFilter"
	StatusFilterQueryKey         = "statusFilter"
	DeviceIdFilterQueryKey       = "deviceIdFilter"
	TimeToLiveQueryKey           = "timeToLive"
	ResourceIdFilterQueryKey     = "resourceIdFilter"
	HttpResourceIdFilterQueryKey = "httpResourceIdFilter"
	AcceptQueryKey               = "accept" // for websocket
	CorrelationIDQueryKey        = "correlationId"
	TimestampFilterQueryKey      = "timestampFilter"
	CorrelationIdFilterQueryKey  = "correlationIdFilter"
	ETagQueryKey                 = "etag"

	AliasInterfaceQueryKey        = "interface"
	AliasCommandFilterQueryKey    = "command"
	AliasDeviceIdFilterQueryKey   = "deviceId"
	AliasResourceIdFilterQueryKey = "resourceId"
	AliasTypeFilterQueryKey       = "type"
	AliasStatusFilterQueryKey     = "status"

	CorrelationIDHeaderKey = "Correlation-Id"
	ContentTypeHeaderKey   = "Content-Type"
	AcceptHeaderKey        = "Accept"
	ETagHeaderKey          = "ETag"

	ResourcesPathKey              = "resources"
	ResourceLinksPathKey          = "resource-links"
	PendingCommandsPathKey        = "pending-commands"
	PendingMetadataUpdatesPathKey = "pending-metadata-updates"
	EventsPathKey                 = "events"

	ApplicationProtoJsonContentType = "application/protojson"

	API               string = "/api/v1"
	APIWS             string = API + "/ws"
	SubscribeToEvents string = APIWS + "/" + EventsPathKey

	// hub configuration
	HubConfiguration = "/.well-known/hub-configuration"
	Configuration    = "/.well-known/configuration"

	// web configuration for ui
	WebConfiguration = "/web_configuration.json"

	// (GRPC + HTTP) GET /api/v1/devices -> rpc GetDevices
	// (GRPC + HTTP) DELETE /api/v1/devices -> rpc DeleteDevices
	Devices = API + "/devices"
	// (HTTP ALIAS) GET /api/v1/devices/{deviceId} -> rpc GetDevices + deviceIdFilter
	// (HTTP ALIAS) DELETE /api/v1/devices/{deviceId} -> rpc DeleteDevices + deviceIdFilter
	AliasDevice = Devices + "/{" + DeviceIDKey + "}"

	// (GRPC + HTTP) GET /api/v1/resource-links -> rpc GetResourceLinks
	ResourceLinks = API + "/" + ResourceLinksPathKey
	// (HTTP ALIAS) GET /api/v1/devices/{deviceId}/resource-links
	AliasDeviceResourceLinks = AliasDevice + "/" + ResourceLinksPathKey

	Resources = API + "/" + ResourcesPathKey

	// (GRPC + HTTP) GET /api/v1/devices/devices-metadata
	DevicesMetadata = API + "/devices-metadata"

	// (GRPC + HTTP) GET /api/v1/devices/devices-metadata
	DeviceMetadata = AliasDevice + "/metadata"

	// (HTTP ALIAS) GET /api/v1/devices/{deviceId}/resources/{resourceHref}?twin=false -> rpc RetrieveResourceFromDevice
	// (GRPC + HTTP) PUT /api/v1/devices/{deviceId}/resources/{resourceHref} -> rpc Update Resource
	AliasDeviceResource = AliasDeviceResources + "/{" + ResourceHrefKey + "}"

	// (GRPC + HTTP) DELETE /api/v1/devices/{deviceId}/resource-links/{resourceHref} -> rpc DeleteResource
	// (GRPC + HTTP) CREATE /api/v1/devices/{deviceId}/resource-links/{resourceHref} -> rpc CreateResource
	DeviceResourceLink = AliasDeviceResourceLinks + "/{" + ResourceHrefKey + "}"

	// (HTTP ALIAS) GET /api/v1/devices/{deviceId}/resources/ -> rpc RetrieveResources + deviceIdFilter
	AliasDeviceResources = AliasDevice + "/" + ResourcesPathKey

	// (GRPC + HTTP) GET /api/v1/pending-commands -> rpc RetrievePendingCommands
	// (GRPC + HTTP) DELETTE /api/v1/pending-commands -> rpc CancelPendingCommands
	PendingCommands = API + "/" + PendingCommandsPathKey

	// (HTTP ALIAS) GET /api/v1/devices/{deviceId}/pending-commands == rpc RetrievePendingCommands + deviceIdFilter
	AliasDevicePendingCommands = AliasDevice + "/" + PendingCommandsPathKey

	// (GRPC + HTTP) GET /api/v1/devices/{device_id}/pending-metadata-updates == rpc CancelPendingMetadataUpdates
	// (GRPC + HTTP) DELETE /api/v1/devices/{deviceId}/pending-metadata-updates == rpc CancelPendingMetadataUpdates
	AliasDevicePendingMetadataUpdates = AliasDevice + "/" + PendingMetadataUpdatesPathKey
	// (GRPC + HTTP) DELETE /api/v1/devices/{deviceId}/pending-metadata-updates/{correlationId} == rpc CancelPendingMetadataUpdates + correlationIdFilter
	AliasDevicePendingMetadataUpdate = AliasDevice + "/" + PendingMetadataUpdatesPathKey + "/" + "{" + CorrelationIDKey + "}"

	// (HTTP ALIAS) GET /api/v1/devices/{deviceId}/resources/{resourceHref}/pending-commands == rpc RetrievePendingCommands + resourceIdFilter
	// (HTTP ALIAS) DELETE /api/v1/devices/{deviceId}/resources/{resourceHref}/pending-commands == rpc CancelPendingCommands + deviceIdFilter
	AliasResourcePendingCommands = AliasDeviceResource + "/" + PendingCommandsPathKey

	// (GRPC + HTTP) GET /api/v1/events -> rpc GetEvents
	// (GRPC + HTTP) GET /api/v1/events?timestampFilter={timestamp} -> rpc GetEvents + timestampFilter
	Events = API + "/" + EventsPathKey

	// (HTTP ALIAS) GET /api/v1/devices/{deviceId}/events == rpc GetEvents + deviceIdFilter
	// (HTTP ALIAS) GET /api/v1/devices/{deviceId}/events?timestampFilter={timestamp} == rpc GetEvents + deviceIdFilter + timestampFilter
	AliasDeviceEvents = AliasDevice + "/" + EventsPathKey

	// (HTTP ALIAS) GET /api/v1/devices/{deviceId}/resources/{resourceHref}/events == rpc GetEvents + resourceIdFilter
	// (HTTP ALIAS) GET /api/v1/devices/{deviceId}/resources/{resourceHref}/events?timestampFilter={timestamp} == rpc GetEvents + resourceIdFilter + timestampFilter
	AliasResourceEvents = AliasDeviceResource + "/" + EventsPathKey
)

Variables

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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