Skip to main content

Object

The objects of the object store of the fleet, such as a file uploaded with osapi client file upload. osapi behavior get --name object and osapi behavior method get show the same.

Behavior​

Nameobject
DescriptionThe objects of the object store of the fleet, such as a file uploaded with osapi client file upload
Placementnode
Internalyes
APIno
CLIno
Nextno
Platformsdebian, linux, darwin
Sudonone
Runsnone
Writesnone
Keeps stateno
Usesnone
Used byservice

Methods (1)​

NAMEVERBROUTEPERMISSIONDESCRIPTION
getread--Get an object of the object store

Types (1)​

NAMEINPUTOUTPUT
getGetInput { name* }Object { name, content, content_type, sha256 }

Settings (0)​

None. Declare them with behavior.Config.

Telemetry​

Spanbehavior.object.<method>
Child spansnone
Metricsosapi_behavior_calls_total, osapi_behavior_duration_seconds, osapi_behavior_changes_total
Attributesosapi.behavior.name, osapi.behavior.method, osapi.behavior.verb, osapi.behavior.outcome, osapi.behavior.changed
Recorded inputsname (get)

Method get​

Nameget
Verbread
DescriptionGet an object of the object store
DetailReads the object from the object store of the fleet, with the content type that its upload gave it, raw or template, and the SHA-256 of its content. A template is not rendered: the behavior that deploys it renders it. An agent with no object store reports skipped.
Routeother behaviors only; it is not served
Input typeGetInput
Output typeObject

Input (1)​

FIELDTYPEREQUIREDCONSTRAINTSDESCRIPTION
namestringyesmin length 1, max length 255The name of the object, as osapi client file upload stored it, such as nginx.conf

Output (4)​

FIELDTYPEDESCRIPTION
namestringThe name of the object
contentstringThe content of the object
content_typestringraw, or template for an object whose content is a Go template
sha256stringThe SHA-256 of the content, in hex

Examples (2)​

EXAMPLEINPUTOUTPUT
A unit filename=example.servicename=example.service, content=[Unit] Description=Example [Service] ExecStart=/usr/bin/example , content_type=raw, sha256=4d38310b40344ae465b2f1f88758809f31ef1aa8287c756a1d65c76ca27dc243
A templatename=motd.tmplname=motd.tmpl, content=Welcome to {{ .Hostname }} , content_type=template, sha256=08c60853fd0933d9903a112a64bb4c742c03961a4e56af1940173403a09746e2