Documentation
¶
Index ¶
- func AddThingToGroup(ctx context.Context, thingName, groupName string) error
- func AttachCertificateToThing(ctx context.Context, thingName, certArn string) error
- func AttachDefaultPolicy(ctx context.Context, certArn string, capabilities []string) error
- func CreateSignalingChannel(ctx context.Context, channelName string) error
- func CreateThing(ctx context.Context, thingName string) error
- func CreateThingGroup(ctx context.Context, groupName string, parentGroupName string) error
- func CreateThingWithAttributes(ctx context.Context, thingName string, attributes map[string]string) error
- func DeleteCertificate(ctx context.Context, certID string) error
- func DeleteThing(ctx context.Context, thingName string) error
- func DescribeCertificateARN(ctx context.Context, certID string) (string, error)
- func DescribeThingGroup(ctx context.Context, groupName string) (*iot.DescribeThingGroupOutput, error)
- func DetachThingPrincipal(ctx context.Context, thingName, principal string) error
- func ExtractCertIDFromARN(arn string) (string, error)
- func GetCertIDFromPEM(certPEM string) (string, error)
- func GetThingCertificates(ctx context.Context, thingName string) ([]*types.CertificateDescription, error)
- func HasCapability(capabilities []string, target string) bool
- func ListThingGroups(ctx context.Context) ([]string, error)
- func RegisterCertificate(ctx context.Context, certPEM string) (string, error)
- func UpdateCertificate(ctx context.Context, certID string, status types.CertificateStatus) error
- func UpdateThingAttribute(ctx context.Context, thingName, attributeKey, attributeValue string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddThingToGroup ¶
AddThingToGroup adds a thing to a thing group
func AttachCertificateToThing ¶
AttachCertificateToThing attaches a certificate to a thing
func AttachDefaultPolicy ¶
AttachDefaultPolicy attaches the default thing policy to a certificate. Per-capability additions owned by core are attached on top of the base policy:
- "s3" → rmng-node-file-policy (S3 file access via IoT Credential Provider)
- "kvs" → rmng-node-video-policy (KVS access via IoT Credential Provider)
Capability policies owned by a separately-deployed optional stack are attached out-of-band by the node-register lifecycle hook (nodelifecycle.OnNodeRegister), not here.
func CreateSignalingChannel ¶
CreateSignalingChannel creates a KVS signaling channel with the given name. Returns nil if the channel already exists (idempotent).
func CreateThing ¶
CreateThing creates a new thing in AWS IoT Core
func CreateThingGroup ¶
CreateThingGroup creates a thing group, optionally under a parent group.
func CreateThingWithAttributes ¶
func CreateThingWithAttributes(ctx context.Context, thingName string, attributes map[string]string) error
CreateThingWithAttributes creates an IoT Thing with the provided attribute payload. Pass a nil/empty map for no attributes (identical to CreateThing). Used to create child Things with custom attributes.
func DeleteCertificate ¶
DeleteCertificate deletes a certificate from AWS IoT Core
func DeleteThing ¶
DeleteThing deletes a thing from AWS IoT Core. Idempotent — returns nil if the thing does not exist. The node-registration rollback path (and other cleanup flows) rely on this being safe to call twice.
func DescribeCertificateARN ¶
DescribeCertificateARN returns the canonical ARN for an existing AWS IoT certificate. Used by the registration retry path to recover an ARN for a cert that was registered by an earlier (partial) attempt.
func DescribeThingGroup ¶
func DescribeThingGroup(ctx context.Context, groupName string) (*iot.DescribeThingGroupOutput, error)
DescribeThingGroup returns metadata for a thing group, or nil if it does not exist.
func DetachThingPrincipal ¶
DetachThingPrincipal detaches a certificate from a thing
func ExtractCertIDFromARN ¶
func GetCertIDFromPEM ¶
GetCertIDFromPEM derives the AWS IoT certificate ID for a PEM-encoded certificate without making an API call. AWS IoT defines the cert ID as the lowercase hex SHA-256 of the certificate's DER bytes; computing it locally lets us recover the cert's identity (and ARN, via DescribeCertificate) when RegisterCertificate returns ResourceAlreadyExistsException on retry.
func GetThingCertificates ¶
func HasCapability ¶
HasCapability checks if a specific capability is present in the capabilities slice.
func RegisterCertificate ¶
RegisterCertificate registers a certificate with AWS IoT Core
func UpdateCertificate ¶
func UpdateThingAttribute ¶
func UpdateThingAttribute(ctx context.Context, thingName, attributeKey, attributeValue string) error
UpdateThingAttribute sets a single attribute on an IoT thing. Pass an empty string as attributeValue to effectively clear the attribute. This is a best-effort operation; callers should log but not propagate errors.
Types ¶
This section is empty.