# Code generated by internal/behavior/gen/group. DO NOT EDIT. openapi: 3.0.0 info: title: osapi description: | Typed, repeatable operations for Linux and macOS hosts. Give your agent a fleet, not a shell. osapi lets an AI agent manage Linux and macOS hosts through typed operations, not through a login. Each operation is a behavior: one thing on a host, defined one time, with a fixed input and output. osapi checks each request before it queues it. A second run changes nothing. Each change is recorded. version: 1.0.0 contact: url: https://github.com/osapi-io/osapi license: name: MIT License url: https://opensource.org/licenses/MIT tags: - description: The systemd services of the host name: Service_API_service_operations x-displayName: Service x-osapi-area: services x-osapi-group: service - description: The packages installed on the host name: Package_API_package_operations x-displayName: Package x-osapi-area: software x-osapi-group: package - description: The updates the package index has for the host name: Updates_API_updates_operations x-displayName: Package updates x-osapi-area: software x-osapi-group: updates - description: Files of the object store, deployed to the host name: File_API_file_operations x-displayName: File x-osapi-area: config x-osapi-group: file - description: Get or set the hostname of target hosts name: Hostname_API_hostname_operations x-displayName: Hostname x-osapi-area: config x-osapi-group: hostname - description: The NTP servers of chrony, and its sync status name: Ntp_API_ntp_operations x-displayName: NTP x-osapi-area: config x-osapi-group: ntp - description: The cron entries that osapi deploys name: Schedule_API_schedule_operations x-displayName: Schedule x-osapi-area: config x-osapi-group: schedule - description: Kernel parameters, written to sysctl.d files and applied name: Sysctl_API_sysctl_operations x-displayName: Sysctl x-osapi-area: config x-osapi-group: sysctl - description: The timezone of the host name: Timezone_API_timezone_operations x-displayName: Timezone x-osapi-area: config x-osapi-group: timezone - description: Get the load averages of target hosts name: Load_API_load_operations x-displayName: Load x-osapi-area: node x-osapi-group: load - description: Get the operating system of target hosts name: Os_API_os_operations x-displayName: OS x-osapi-area: node x-osapi-group: os - description: Reboot or shut down the host name: Power_API_power_operations x-displayName: Power x-osapi-area: node x-osapi-group: power - description: The processes of the host name: Process_API_process_operations x-displayName: Process x-osapi-area: node x-osapi-group: process - description: The status summary of a node name: Status_API_status_operations x-displayName: Status x-osapi-area: node x-osapi-group: status - description: Get the uptime of target hosts name: Uptime_API_uptime_operations x-displayName: Uptime x-osapi-area: node x-osapi-group: uptime - description: The entries of the systemd journal name: Log_API_log_operations x-displayName: Log x-osapi-area: logs x-osapi-group: log - description: The sources that write to the systemd journal name: Source_API_source_operations x-displayName: Log source x-osapi-area: logs x-osapi-group: source - description: Whether the host reaches an address, by ICMP ping name: Connectivity_API_connectivity_operations x-displayName: Connectivity x-osapi-area: networking x-osapi-group: connectivity - description: The DNS resolvers of each interface of the host name: Dns_API_dns_operations x-displayName: DNS x-osapi-area: networking x-osapi-group: dns - description: The network interfaces of the host name: Interface_API_interface_operations x-displayName: Interface x-osapi-area: networking x-osapi-group: interface - description: The routes of an interface name: Route_API_route_operations x-displayName: Interface route x-osapi-area: networking x-osapi-group: route - description: The certificate authorities that the host trusts name: Certificate_API_certificate_operations x-displayName: Certificate x-osapi-area: security x-osapi-group: certificate - description: The groups of the host name: Group_API_group_operations x-displayName: Group x-osapi-area: security x-osapi-group: group - description: The users of the host name: User_API_user_operations x-displayName: User x-osapi-area: security x-osapi-group: user - description: The password of a user name: Password_API_password_operations x-displayName: User password x-osapi-area: security x-osapi-group: password - description: The authorized SSH keys of a user name: Sshkey_API_sshkey_operations x-displayName: User SSH key x-osapi-area: security x-osapi-group: sshkey - description: The Docker containers of the host name: Docker_API_docker_operations x-displayName: Container x-osapi-area: containers x-osapi-group: docker - description: The Docker images of the host name: Image_API_image_operations x-displayName: Container image x-osapi-area: containers x-osapi-group: image - description: Object Store file management operations. name: File_Management_API_file_operations x-displayName: File x-osapi-area: objectstore x-osapi-group: file - description: The vaults of the controller and the metadata of their keys. No operation gives a value. name: Secret_Management_API_secret_operations x-displayName: Secret x-osapi-area: secrets x-osapi-group: secret - description: Run a command on target hosts name: Command_API_command_operations x-displayName: Command x-osapi-area: command x-osapi-group: command - description: Get the disk usage of target hosts name: Disk_API_disk_operations x-displayName: Disk x-osapi-area: hardware x-osapi-group: disk - description: Get the memory usage of target hosts name: Memory_API_memory_operations x-displayName: Memory x-osapi-area: hardware x-osapi-group: memory - description: Audit log endpoints for viewing API activity. name: Audit_Log_API_audit x-displayName: Audit x-osapi-area: audit x-osapi-group: audit - description: Admit, reject and revoke the nodes that ask to join. name: Admission_API_admission x-displayName: Admission x-osapi-area: fleet x-osapi-group: admission - description: Operations related to agent discovery and details. name: Agent_Management_API_agent_operations x-displayName: Agent x-osapi-area: fleet x-osapi-group: agent - description: The behaviors, the permissions and the roles that the controller serves, for the UI. name: Catalog_API_catalog x-displayName: Catalog x-osapi-area: fleet x-osapi-group: catalog - description: Health check endpoints for liveness, readiness, and detailed status. name: Health_Check_API_health x-displayName: Health x-osapi-area: fleet x-osapi-group: health - description: Operations related to the job queue. name: Job_Management_API_job_operations x-displayName: Job x-osapi-area: fleet x-osapi-group: job - description: Telemetry through the controller, such as the spans of a trace. name: Telemetry_API_telemetry x-displayName: Telemetry x-osapi-area: fleet x-osapi-group: telemetry paths: /api/admission: get: description: 'Returns each machine''s admission record: pending, admitted, rejected or revoked, with whether it is online and when it was last seen.' operationId: GetAdmissions parameters: - description: 'Only the records in this state: pending, admitted, rejected or revoked.' in: query name: state schema: $ref: '#/components/schemas/AdmissionState' x-oapi-codegen-extra-tags: validate: omitempty,enum responses: "200": content: application/json: schema: $ref: '#/components/schemas/ListAdmissionResponse' description: The admission records. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - admission:read summary: List admission records tags: - Admission_API_admission x-osapi-area: fleet x-osapi-examples: - doc: List admission records input: {} - doc: List admission records, with --state pending input: state: pending x-osapi-method: list /api/admission/{machine_id}: delete: description: Removes a machine's key and each record of it, and keeps none. A machine that asks again is new. Use it for a machine that goes away on purpose, such as a VM that is rebuilt; revoke a machine that is not trusted. operationId: DeleteMachine parameters: - description: The machine ID of the node. in: path name: machine_id required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 responses: "204": description: The machine is deleted. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: No record of the machine. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - admission:write summary: Delete a machine tags: - Admission_API_admission x-osapi-area: fleet x-osapi-examples: - doc: Delete a machine input: machine_id: d530664edc1c431eb5ef1e9dfd6617a5 x-osapi-method: delete get: description: Returns one machine's admission record by machine ID. operationId: GetAdmission parameters: - description: The machine ID of the node. in: path name: machine_id required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 responses: "200": content: application/json: schema: $ref: '#/components/schemas/Admission' description: The admission record. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: No admission record for the machine. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - admission:read summary: Get a machine's admission record tags: - Admission_API_admission x-osapi-area: fleet x-osapi-examples: - doc: Get a machine's admission record input: machine_id: d530664edc1c431eb5ef1e9dfd6617a5 x-osapi-method: get /api/admission/{machine_id}/admit: post: description: 'Admits a pending machine. The fingerprint must be the one that `osapi agent key fingerprint` prints on the machine: it proves that the request came from the machine the operator is looking at.' operationId: AdmitMachine parameters: - description: The machine ID of the node. in: path name: machine_id required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 requestBody: content: application/json: schema: $ref: '#/components/schemas/AdmitRequest' required: true responses: "204": description: The machine is admitted. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: No pending request from the machine. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The fingerprint does not match the request. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - admission:write summary: Admit a pending machine tags: - Admission_API_admission x-osapi-area: fleet x-osapi-examples: - doc: Admit a pending machine input: fingerprint: SHA256:1f53dea6... machine_id: d530664edc1c431eb5ef1e9dfd6617a5 x-osapi-method: admit /api/admission/{machine_id}/reject: post: description: Rejects a pending machine, and keeps a record of the decision, so a machine that asks again is flagged. operationId: RejectMachine parameters: - description: The machine ID of the node. in: path name: machine_id required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 requestBody: content: application/json: schema: $ref: '#/components/schemas/RejectRequest' required: true responses: "204": description: The machine is rejected. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: No pending request from the machine. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - admission:write summary: Reject a pending machine tags: - Admission_API_admission x-osapi-area: fleet x-osapi-examples: - doc: Reject a pending machine input: machine_id: d530664edc1c431eb5ef1e9dfd6617a5 reason: unknown host x-osapi-method: reject /api/admission/{machine_id}/revoke: post: description: Removes an admitted machine's key, and keeps a record of the decision. Nothing the machine signs verifies afterwards; to return, it asks again. operationId: RevokeMachine parameters: - description: The machine ID of the node. in: path name: machine_id required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 responses: "204": description: The machine is revoked. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: No admitted machine with the ID. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - admission:write summary: Revoke an admitted machine tags: - Admission_API_admission x-osapi-area: fleet x-osapi-examples: - doc: Revoke an admitted machine input: machine_id: d530664edc1c431eb5ef1e9dfd6617a5 x-osapi-method: revoke /api/agent: get: description: Discover all active agents in the fleet. operationId: GetAgents responses: "200": content: application/json: schema: $ref: '#/components/schemas/ListAgentsResponse' description: List of active agents. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - agent:read summary: List active agents tags: - Agent_Management_API_agent_operations x-osapi-area: fleet x-osapi-examples: - doc: List active agents input: {} x-osapi-method: list /api/agent/{hostname}: get: description: Get detailed information about a specific agent by hostname. operationId: GetAgentDetails parameters: - description: The hostname of the agent to retrieve. in: path name: hostname required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 responses: "200": content: application/json: schema: $ref: '#/components/schemas/AgentInfo' description: Agent details. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Agent not found "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - agent:read summary: Get agent details tags: - Agent_Management_API_agent_operations x-osapi-area: fleet x-osapi-examples: - doc: Get agent details input: hostname: web-01 x-osapi-method: get /api/agent/{hostname}/drain: post: description: Stop the agent from accepting new jobs. In-flight jobs continue to completion. operationId: DrainAgent parameters: - description: The hostname of the agent to drain. in: path name: hostname required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 responses: "204": description: Agent drain initiated. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Agent not found. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Agent already in requested state. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - agent:write summary: Drain an agent tags: - Agent_Management_API_agent_operations x-osapi-area: fleet x-osapi-examples: - doc: Drain an agent input: hostname: web-01 x-osapi-method: drain /api/agent/{hostname}/undrain: post: description: Resume accepting jobs on a drained agent. operationId: UndrainAgent parameters: - description: The hostname of the agent to undrain. in: path name: hostname required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 responses: "204": description: Agent undrain initiated. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Agent not found. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Agent not in draining or cordoned state. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - agent:write summary: Undrain an agent tags: - Agent_Management_API_agent_operations x-osapi-area: fleet x-osapi-examples: - doc: Undrain an agent input: hostname: web-01 x-osapi-method: undrain /api/agent/config/{hostname}: get: description: Returns the config that the controller holds for the agent, with its version. operationId: GetAgentConfig parameters: - description: The hostname of the agent. in: path name: hostname required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 responses: "200": content: application/json: schema: $ref: '#/components/schemas/AgentConfigResponse' description: The config of the agent. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Agent not found. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - agent:read summary: Read the config of an agent tags: - Agent_Management_API_agent_operations x-osapi-area: fleet x-osapi-examples: - doc: Read the config of an agent input: hostname: web-01 x-osapi-method: getconfig put: description: 'Sets the labels of the agent as the next version of its config. The agent applies them at once: it takes the jobs of the new labels, and no restart is necessary.' operationId: PutAgentConfig parameters: - description: The hostname of the agent. in: path name: hostname required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 requestBody: content: application/json: schema: $ref: '#/components/schemas/AgentConfigRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/AgentConfigResponse' description: The config of the agent after the change. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Agent not found. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - agent:write summary: Set the config of an agent tags: - Agent_Management_API_agent_operations x-osapi-area: fleet x-osapi-examples: - doc: Set the config of an agent input: hostname: web-01 labels: dc: east group: web x-osapi-method: setconfig /api/agent/facts: get: description: 'Returns the fact keys that an input can refer to as @fact.: the built-in keys and the custom keys that agents register.' operationId: GetAgentFacts responses: "200": content: application/json: schema: $ref: '#/components/schemas/FactKeysResponse' description: The fact keys. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - agent:read summary: List the fact keys tags: - Agent_Management_API_agent_operations x-osapi-area: fleet x-osapi-examples: - doc: List the fact keys input: {} x-osapi-method: facts /api/agent/join: post: description: 'An agent calls it one time, at its first start, over HTTPS, after it checks the controller''s certificate against the fingerprint of its join string. A token that admits admits the machine at once, as admit does, and the admission record names the token. The request is signed with the agent''s signing key, which shows that it holds the key that it asks the controller to admit. It needs no bearer token: the join token authorizes it.' operationId: JoinAgent requestBody: content: application/json: schema: $ref: '#/components/schemas/JoinRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/JoinResponse' description: The machine is admitted. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not signed by the key that it asks to admit. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. "503": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: This controller takes no join. security: [] summary: Join an agent with a join token tags: - Agent_Management_API_agent_operations x-osapi-area: fleet x-osapi-method: join x-osapi-program: true /api/audit: get: description: Returns a paginated list of audit log entries, newest first. A token with a target scope gets only the entries of requests to a target in its scope, and the total includes only those entries. operationId: GetAuditLogs parameters: - description: Maximum number of entries to return. in: query name: limit schema: default: 20 maximum: 100 minimum: 1 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=1,max=100 - description: Number of entries to skip. in: query name: offset schema: default: 0 minimum: 0 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=0 - description: 'Only the requests that change something: each method but GET.' in: query name: writes schema: type: boolean x-oapi-codegen-extra-tags: validate: omitempty - description: Only the entries of this user, the subject of the token. in: query name: user schema: maxLength: 256 type: string x-oapi-codegen-extra-tags: validate: omitempty,max=256 - description: Only the entries whose operation ID or path has this text, such as hostname. in: query name: operation schema: maxLength: 256 type: string x-oapi-codegen-extra-tags: validate: omitempty,max=256 - description: Only the entries with this response status, such as 403. in: query name: status schema: maximum: 599 minimum: 100 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=100,max=599 responses: "200": content: application/json: schema: $ref: '#/components/schemas/ListAuditResponse' description: List of audit entries. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. "503": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The audit log is not configured on the controller. security: - BearerAuth: - audit:read summary: List audit log entries tags: - Audit_Log_API_audit x-osapi-area: audit x-osapi-examples: - doc: List audit log entries input: {} - doc: List audit log entries, with --limit 10 --offset 20 input: limit: 10 offset: 20 - doc: List audit log entries, with --writes --user ops@example.com input: user: ops@example.com writes: true - doc: List audit log entries, with --operation hostname --status 403 input: operation: hostname status: 403 x-osapi-method: list /api/audit/{id}: get: description: Returns a single audit log entry by ID. An entry of a request to a target outside the target scope of the token is not found. operationId: GetAuditLogByID parameters: - description: The audit entry ID. in: path name: id required: true schema: format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid responses: "200": content: application/json: schema: $ref: '#/components/schemas/AuditEntryResponse' description: Audit entry found. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Audit entry not found, or its target is outside the token's target scope. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. "503": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The audit log is not configured on the controller. security: - BearerAuth: - audit:read summary: Get a single audit log entry tags: - Audit_Log_API_audit x-osapi-area: audit x-osapi-examples: - doc: Get a single audit log entry input: id: 550e8400-e29b-41d4-a716-446655440000 x-osapi-method: get /api/audit/export: get: description: Returns all audit log entries without pagination for export. A token with a target scope gets only the entries of requests to a target in its scope. operationId: GetAuditExport responses: "200": content: application/json: schema: $ref: '#/components/schemas/ListAuditResponse' description: All audit entries. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. "503": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The audit log is not configured on the controller. security: - BearerAuth: - audit:read summary: Export all audit log entries tags: - Audit_Log_API_audit x-osapi-area: audit x-osapi-examples: - doc: Export all audit log entries input: {} x-osapi-method: export /api/catalog: get: description: Returns each behavior with its methods, the areas, the permissions, the built-in roles, the permission of each operation, the tones of the statuses and the counts, and the host families. The UI reads it after sign-in. Each built-in role has catalog:read. operationId: GetCatalog responses: "200": content: application/json: schema: $ref: '#/components/schemas/CatalogResponse' description: The catalog. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - catalog:read summary: Get the catalog tags: - Catalog_API_catalog x-osapi-area: fleet x-osapi-examples: - doc: Get the catalog input: {} x-osapi-method: get /api/file: get: description: List all files stored in the Object Store. operationId: GetFiles responses: "200": content: application/json: schema: $ref: '#/components/schemas/FileListResponse' description: List of stored files. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. "503": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The Object Store is not configured on the controller. security: - BearerAuth: - file:read summary: List stored files tags: - File_Management_API_file_operations x-osapi-area: objectstore x-osapi-examples: - doc: List stored files input: {} x-osapi-method: list post: description: Upload a file to the Object Store. operationId: PostFile requestBody: content: multipart/form-data: schema: properties: content_type: $ref: '#/components/schemas/ContentType' file: description: The file content. format: binary minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1 name: description: The name of the file in the Object Store. example: nginx.conf maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 required: - name - file type: object required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/FileUploadResponse' description: The file exists with the same content. Nothing changed. "201": content: application/json: schema: $ref: '#/components/schemas/FileUploadResponse' description: The file is new. headers: Location: description: The URL of the resource that the request created. schema: type: string "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The file is an osapi file, which a caller cannot write. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The file exists with different content. Replace it with PUT /api/file/{name}. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. "503": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The Object Store is not configured on the controller. security: - BearerAuth: - file:write summary: Upload a file tags: - File_Management_API_file_operations x-osapi-area: objectstore x-osapi-examples: - doc: Upload a file input: file: /tmp/app.conf name: app.conf - doc: Upload a file, with --name app.conf.tmpl --file /tmp/app.conf.tmpl --content-type template input: content_type: template file: /tmp/app.conf.tmpl name: app.conf.tmpl x-osapi-method: upload /api/file/{name}: delete: description: Delete a file from the Object Store. operationId: DeleteFileByName parameters: - description: The name of the file in the Object Store. in: path name: name required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 responses: "204": description: File deleted. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The file is an osapi file, which a caller cannot delete. "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: File not found. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. "503": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The Object Store is not configured on the controller. security: - BearerAuth: - file:write summary: Delete a file tags: - File_Management_API_file_operations x-osapi-area: objectstore x-osapi-examples: - doc: Delete a file input: name: app.conf x-osapi-method: delete get: description: Get metadata for a specific file in the Object Store. operationId: GetFileByName parameters: - description: The name of the file in the Object Store. in: path name: name required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 responses: "200": content: application/json: schema: $ref: '#/components/schemas/FileInfoResponse' description: The metadata of the file. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: File not found. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. "503": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The Object Store is not configured on the controller. security: - BearerAuth: - file:read summary: Get file metadata tags: - File_Management_API_file_operations x-osapi-area: objectstore x-osapi-examples: - doc: Get file metadata input: name: app.conf x-osapi-method: get put: description: Replace a file in the Object Store, or create it when the name is new. operationId: PutFileByName parameters: - description: The name of the file in the Object Store. in: path name: name required: true schema: maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 requestBody: content: multipart/form-data: schema: properties: content_type: $ref: '#/components/schemas/ContentType' file: description: The file content. format: binary minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1 required: - file type: object required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/FileUploadResponse' description: The file existed. changed says whether its content changed. "201": content: application/json: schema: $ref: '#/components/schemas/FileUploadResponse' description: The file is new. headers: Location: description: The URL of the resource that the request created. schema: type: string "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The file is an osapi file, which a caller cannot write. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. "503": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The Object Store is not configured on the controller. security: - BearerAuth: - file:write summary: Replace a file tags: - File_Management_API_file_operations x-osapi-area: objectstore x-osapi-examples: - doc: Replace a file input: file: /tmp/app.conf name: app.conf x-osapi-method: update /api/file/stale: get: description: Returns deployments where the source object in the Object Store has been updated since the file was last deployed. Controller-only check that compares state KV SHA-256 hashes against current object content. operationId: GetFileStale responses: "200": content: application/json: schema: $ref: '#/components/schemas/StaleDeploymentsResponse' description: The stale deployments. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. "503": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The Object Store or the file state KV is not configured. security: - BearerAuth: - file:read summary: List stale file deployments tags: - File_Management_API_file_operations x-osapi-area: objectstore x-osapi-examples: - doc: List stale file deployments input: {} x-osapi-method: stale /api/health: get: description: Returns 200 if the process is alive. No checks performed. operationId: GetHealth responses: "200": content: application/json: schema: $ref: '#/components/schemas/HealthResponse' description: Process is alive. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: [] summary: Liveness probe tags: - Health_Check_API_health x-osapi-area: fleet x-osapi-examples: - doc: Liveness probe input: {} x-osapi-method: liveness /api/health/ready: get: description: Returns 200 when the service is ready to accept traffic. operationId: GetHealthReady responses: "200": content: application/json: schema: $ref: '#/components/schemas/ReadyResponse' description: Service is ready. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. "503": content: application/json: schema: $ref: '#/components/schemas/ReadyResponse' description: Service is not ready. security: [] summary: Readiness probe tags: - Health_Check_API_health x-osapi-area: fleet x-osapi-examples: - doc: Readiness probe input: {} x-osapi-method: ready /api/health/status: get: description: Returns per-component health status with system metrics. Requires authentication. operationId: GetHealthStatus parameters: - description: 'Show only the components of this type: controller, nats or agent. The other parts of the status stay.' in: query name: component schema: $ref: '#/components/schemas/ComponentType' x-oapi-codegen-extra-tags: validate: omitempty,enum responses: "200": content: application/json: schema: $ref: '#/components/schemas/StatusResponse' description: The status of each component. A component that is not healthy makes the overall status degraded; the request still succeeds. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - health:read summary: System status and component health tags: - Health_Check_API_health x-osapi-area: fleet x-osapi-examples: - doc: System status and component health input: {} - doc: System status and component health, with --component agent input: component: agent x-osapi-method: status /api/job: get: description: Retrieve jobs, optionally filtered by status. A token with a target scope gets only the jobs whose target is in its scope, and the counts include only those jobs. operationId: GetJobs parameters: - description: Filter jobs by status. in: query name: status schema: $ref: '#/components/schemas/JobStatus' x-oapi-codegen-extra-tags: validate: omitempty,enum - description: Maximum number of jobs per page (1-100). in: query name: limit schema: default: 10 maximum: 100 minimum: 1 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=1,max=100 - description: Number of jobs to skip for pagination. in: query name: offset schema: default: 0 minimum: 0 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=0 responses: "200": content: application/json: schema: $ref: '#/components/schemas/ListJobsResponse' description: A list of jobs. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - job:read summary: List jobs tags: - Job_Management_API_job_operations x-osapi-area: fleet x-osapi-examples: - doc: List jobs input: {} - doc: List jobs, with --status completed --limit 3 input: limit: 3 status: completed x-osapi-method: list /api/job/{id}: delete: description: Delete a specific job by its ID. A job whose target is outside the target scope of the token is not found. operationId: DeleteJobByID parameters: - description: UUID of the job to delete. in: path name: id required: true schema: format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid responses: "204": description: Job deleted successfully. No content returned. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Job not found, or its target is outside the token's target scope. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - job:write summary: Delete a job tags: - Job_Management_API_job_operations x-osapi-area: fleet x-osapi-examples: - doc: Delete a job input: id: 550e8400-e29b-41d4-a716-446655440000 x-osapi-method: delete get: description: Retrieve details of a specific job by its ID. A job whose target is outside the target scope of the token is not found. operationId: GetJobByID parameters: - description: UUID of the job to retrieve. in: path name: id required: true schema: format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid responses: "200": content: application/json: schema: $ref: '#/components/schemas/JobDetailResponse' description: The job details. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Job not found, or its target is outside the token's target scope. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - job:read summary: Get job detail tags: - Job_Management_API_job_operations x-osapi-area: fleet x-osapi-examples: - doc: Get job detail input: id: 550e8400-e29b-41d4-a716-446655440000 x-osapi-method: get /api/job/{id}/retry: post: description: Create a new job using the same operation data as an existing job. The original job is preserved. Returns the new job ID. operationId: RetryJobByID parameters: - description: UUID of the job to retry. in: path name: id required: true schema: format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid requestBody: content: application/json: schema: $ref: '#/components/schemas/RetryJobRequest' responses: "201": content: application/json: schema: $ref: '#/components/schemas/CreateJobResponse' description: The retry job was created successfully. headers: Location: description: The URL of the resource that the request created. schema: type: string "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Invalid request parameters, or a job with no operation data to run again. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Insufficient permissions, or a target outside the token's target scope. "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Job not found, or its target is outside the token's target scope. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - job:write summary: Retry a job tags: - Job_Management_API_job_operations x-osapi-area: fleet x-osapi-examples: - doc: Retry a job input: id: 550e8400-e29b-41d4-a716-446655440000 x-osapi-method: retry /api/secret: get: description: List each vault of controller.secrets.vaults, with its type, its targets and whether it answers. operationId: GetSecretVaults responses: "200": content: application/json: schema: $ref: '#/components/schemas/VaultListResponse' description: The vaults of the controller. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - secret:read summary: List the vaults tags: - Secret_Management_API_secret_operations x-osapi-area: secrets x-osapi-examples: - doc: List the vaults input: {} x-osapi-method: vaults /api/secret/{vault}: get: description: 'List the metadata of each key of a vault: its version, when it changed and who changed it. The list has no value.' operationId: GetSecrets parameters: - description: The name of the vault, such as default. in: path name: vault required: true schema: example: default maxLength: 64 pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,resource_name,max=64 responses: "200": content: application/json: schema: $ref: '#/components/schemas/SecretListResponse' description: The keys of the vault. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The controller has no vault with that name. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - secret:read summary: List the keys of a vault tags: - Secret_Management_API_secret_operations x-osapi-area: secrets x-osapi-examples: - doc: List the keys of a vault input: vault: default x-osapi-method: list /api/secret/{vault}/{key}: delete: description: Delete a key from its vault. A request that uses its reference after that fails. operationId: DeleteSecret parameters: - description: The name of the vault, such as default. in: path name: vault required: true schema: example: default maxLength: 64 pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,resource_name,max=64 - description: The name of the key, such as registry-token. in: path name: key required: true schema: example: registry-token maxLength: 128 pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,resource_name,max=128 responses: "204": description: The key is deleted. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The vault has no key with that name. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - secret:write summary: Delete a key tags: - Secret_Management_API_secret_operations x-osapi-area: secrets x-osapi-examples: - doc: Delete a key input: key: registry-token vault: default x-osapi-method: delete get: description: Get the version of a key, when it changed and who changed it. The answer has no value. operationId: GetSecret parameters: - description: The name of the vault, such as default. in: path name: vault required: true schema: example: default maxLength: 64 pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,resource_name,max=64 - description: The name of the key, such as registry-token. in: path name: key required: true schema: example: registry-token maxLength: 128 pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,resource_name,max=128 responses: "200": content: application/json: schema: $ref: '#/components/schemas/SecretInfo' description: The metadata of the key. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The vault has no key with that name. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - secret:read summary: Get the metadata of a key tags: - Secret_Management_API_secret_operations x-osapi-area: secrets x-osapi-examples: - doc: Get the metadata of a key input: key: registry-token vault: default x-osapi-method: get put: description: Write a value as the next version of a key, or as version 1 of a new key. The answer is the metadata of the key. The API never gives the value back. operationId: PutSecret parameters: - description: The name of the vault, such as default. in: path name: vault required: true schema: example: default maxLength: 64 pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,resource_name,max=64 - description: The name of the key, such as registry-token. in: path name: key required: true schema: example: registry-token maxLength: 128 pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,resource_name,max=128 requestBody: content: application/json: schema: $ref: '#/components/schemas/SecretUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/SecretInfo' description: The metadata of the key after the write. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The controller has no vault with that name. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - secret:write summary: Write the value of a key tags: - Secret_Management_API_secret_operations x-osapi-area: secrets x-osapi-examples: - doc: Read the value from standard input input: key: registry-token value: '-' vault: default x-osapi-method: update /api/secret/{vault}/{key}/value: get: description: Get the value of a key, for a tool that needs the value itself. It is the one method that gives a value, and it needs secret:reveal, which only the admin role has. The audit log records each call, with the vault, the key and the caller, and never the value. operationId: GetSecretValue parameters: - description: The name of the vault, such as default. in: path name: vault required: true schema: example: default maxLength: 64 pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,resource_name,max=64 - description: The name of the key, such as registry-token. in: path name: key required: true schema: example: registry-token maxLength: 128 pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,resource_name,max=128 responses: "200": content: application/json: schema: $ref: '#/components/schemas/SecretValue' description: The value of the key. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The vault has no key with that name. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - secret:reveal summary: Reveal the value of a key tags: - Secret_Management_API_secret_operations x-osapi-area: secrets x-osapi-examples: - doc: Reveal the value of a key input: key: registry-token vault: default x-osapi-method: reveal /api/telemetry/trace/{id}: get: description: Returns each span of a trace, read from the tracing backend at telemetry.tracing.url. The backend gets the spans a few seconds after the request, so a trace of a request that just ran can be not found yet. A token with a target scope gets a trace only when each target that the trace records is in its scope. operationId: GetTrace parameters: - description: The trace ID, which a command prints after its job ID, 32 hexadecimal characters in: path name: id required: true schema: pattern: ^[0-9a-f]{32}$ type: string x-oapi-codegen-extra-tags: validate: required - description: Show the NATS calls too, the reads and writes of the job queue in: query name: all schema: type: boolean x-oapi-codegen-extra-tags: validate: omitempty responses: "200": content: application/json: schema: $ref: '#/components/schemas/TraceResponse' description: The spans of the trace. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The backend has no trace with this ID, or not yet, or a target of the trace is outside the token's target scope. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. "503": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: No tracing backend is configured on the controller. security: - BearerAuth: - trace:read summary: Get the spans of a trace tags: - Telemetry_API_telemetry x-osapi-area: fleet x-osapi-examples: - doc: Get the spans of a trace input: id: 26e448c9dbe1c4a8d216a98c675079c9 - doc: Get the spans of a trace, with --id 26e448c9dbe1c4a8d216a98c675079c9 --all input: all: true id: 26e448c9dbe1c4a8d216a98c675079c9 x-osapi-method: get /api/node/{hostname}/certificate: get: description: 'Lists each CA of the trust store through gohai: the distribution''s and the local ones on Linux, from the family''s directories, and the system keychains on macOS, each with its subject, fingerprint and expiry. A CA that osapi deployed reads by the name that it was deployed with, not its file''s osapi- name, and is managed.' operationId: GetNodeCertificate parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/CertificateCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - certificate:read summary: List the certificate authorities that the host trusts tags: - Certificate_API_certificate_operations x-osapi-area: security x-osapi-examples: - doc: A Debian host with a system CA input: hostname: web-01 x-osapi-method: list post: description: 'Writes the PEM of the object as a file with the osapi- prefix, such as osapi-internal-ca.crt for internal-ca, in the family''s local directory: /usr/local/share/ca-certificates on the Debian family, /etc/pki/trust/anchors on SUSE, /etc/pki/ca-trust/source/anchors on RHEL and Fedora. Then it rebuilds the trust store: with update-ca-certificates on the Debian family and SUSE, and with update-ca-trust on the others. Alpine reports skipped. A CA that osapi deployed already with the same content does not change and reports changed: false. A file of that name that osapi did not write is refused. macOS reports skipped.' operationId: PostNodeCertificate parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/CertificateCreateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/CertificateCreateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - certificate:write summary: Add a certificate authority to the trust store tags: - Certificate_API_certificate_operations x-osapi-area: security x-osapi-examples: - doc: Add a CA input: hostname: web-01 name: internal-ca object: internal-ca.pem x-osapi-method: create /api/node/{hostname}/certificate/{name}: delete: description: 'Removes the file of the CA and rebuilds the trust store: with update-ca-certificates --fresh on the Debian family and SUSE, which removes the links of the CA from /etc/ssl/certs, and update-ca-trust on the RHEL family. A CA that osapi did not deploy does not change and reports changed: false: a system CA is not osapi''s to remove. macOS reports skipped.' operationId: DeleteNodeCertificate parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/CertificateName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/CertificateDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no certificate with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - certificate:write summary: Remove a certificate authority that osapi deployed tags: - Certificate_API_certificate_operations x-osapi-area: security x-osapi-examples: - doc: Remove a CA input: hostname: web-01 name: internal-ca x-osapi-method: delete get: description: Reads one CA from the same list, by the name that list gives it. A CA that the host does not trust is not found. A name with a slash, such as a system CA of the Debian family, is in list only. operationId: GetNodeCertificateByKey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/CertificateName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/CertificateGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no certificate with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - certificate:read summary: Get one certificate authority tags: - Certificate_API_certificate_operations x-osapi-area: security x-osapi-examples: - doc: A CA that osapi deployed, by the name it was deployed with input: hostname: web-01 name: internal-ca - doc: A CA of a Mac input: hostname: web-01 name: osapi example CA x-osapi-method: get put: description: Writes the CA from the object, or from the one that it was deployed from when the object is empty, and rebuilds the trust store when the file changed. A CA that osapi did not deploy is not found. macOS reports skipped. operationId: PutNodeCertificate parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/CertificateName' requestBody: content: application/json: schema: $ref: '#/components/schemas/CertificateUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/CertificateUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no certificate with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - certificate:write summary: Write a certificate authority that osapi deployed again tags: - Certificate_API_certificate_operations x-osapi-area: security x-osapi-examples: - doc: Write a CA from a new object input: hostname: web-01 name: internal-ca object: internal-ca-2.pem - doc: The object that it was deployed from input: hostname: web-01 name: internal-ca x-osapi-method: update /api/node/{hostname}/command/exec: post: description: 'Runs the program with its arguments, each one word, with no shell between them: a ; or a | in an argument is that character. It answers with standard output and standard error apart, the exit code and the duration. A program that exits non-zero is a result, not an error. Only the admin role may run it, and the agent runs it only where agent.command.enabled is true.' operationId: PostNodeCommandExec parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/CommandExecRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/CommandExecResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - command:execute summary: Run a program with its arguments tags: - Command_API_command_operations x-osapi-area: command x-osapi-examples: - doc: Print a word input: args: - hello command: echo hostname: web-01 - doc: A program that exits non-zero input: command: "false" hostname: web-01 - doc: In a directory, for at most 5 seconds input: command: "true" cwd: /tmp hostname: web-01 timeout: 5 x-osapi-method: exec /api/node/{hostname}/command/shell: post: description: 'Runs the command line through /bin/sh -c, so pipes, redirects and variables work. It answers as exec does. Its permission is command:shell, apart from exec''s command:execute: a token that may run a program may not open a shell. Only the admin role gets it.' operationId: PostNodeCommandShell parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/CommandShellRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/CommandShellResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - command:shell summary: Run a command line through /bin/sh -c tags: - Command_API_command_operations x-osapi-area: command x-osapi-examples: - doc: A pipe input: command: echo hello | tr a-z A-Z hostname: web-01 - doc: A command line that exits non-zero input: command: exit 3 hostname: web-01 x-osapi-method: shell /api/node/{hostname}/connectivity/ping: post: description: 'Sends three ICMP echo requests from the host and reports how many came back, and their round-trip times. A host that does not answer is 100% loss, not an error. It changes nothing, so it reports changed: false. On Linux the agent pings without root when net.ipv4.ping_group_range admits its group.' operationId: PostNodeConnectivityPing parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/ConnectivityPingRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ConnectivityPingResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - connectivity:execute summary: Ping an address from the host tags: - Connectivity_API_connectivity_operations x-osapi-area: networking x-osapi-examples: - doc: A host that answers input: address: 127.0.0.1 hostname: web-01 - doc: A host that does not answer input: address: 192.0.2.1 hostname: web-01 x-osapi-method: ping /api/node/{hostname}/disk: get: description: 'Reads the size, the used space and the free space of each local filesystem, in bytes: the mounts of /proc/mounts on Linux and of mount on macOS, with their sizes from df. Local is ext4, xfs and btrfs on Linux, and apfs and hfs on macOS. Network and special filesystems are left out.' operationId: GetNodeDisk parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/DiskGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - disk:read summary: Get the disk usage of the host tags: - Disk_API_disk_operations x-osapi-area: hardware x-osapi-examples: - doc: A host with one local filesystem input: hostname: web-01 x-osapi-method: get /api/node/{hostname}/dns/{interface_name}: delete: description: Removes the interface's netplan file and applies what is left. An interface osapi set nothing on does not change. operationId: DeleteNodeDns parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/DnsInterface_name' responses: "200": content: application/json: schema: $ref: '#/components/schemas/DnsDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no dns with that interface_name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - dns:write summary: Drop the DNS resolvers osapi set on an interface tags: - Dns_API_dns_operations x-osapi-area: networking x-osapi-examples: - doc: An interface osapi set input: hostname: web-01 interface_name: osapi0 x-osapi-method: delete get: description: 'Reads the servers and the search domains of the interface: resolvectl on Linux, with resolv.conf on a host that has no resolvers per interface, such as a container, and scutil on macOS.' operationId: GetNodeDnsByKey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/DnsInterface_name' responses: "200": content: application/json: schema: $ref: '#/components/schemas/DnsGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no dns with that interface_name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - dns:read summary: Get the DNS resolvers of an interface tags: - Dns_API_dns_operations x-osapi-area: networking x-osapi-examples: - doc: An interface with servers and a domain input: hostname: web-01 interface_name: osapi0 - doc: A Mac input: hostname: web-01 interface_name: en0 x-osapi-method: get put: description: Writes a netplan file of the interface's own, such as /etc/netplan/osapi-dns-eth0.yaml for eth0, under the netplan definition that matches the interface, and applies it. A definition that matches several interfaces, such as cloud-init's all for en*, gives each of them the resolvers. An empty list keeps the interface's servers or domains, and an interface with no resolvers yet starts from none. override_dhcp drops the servers DHCP gives. It runs on the Debian family, and elsewhere, and in a container, reports skipped. operationId: PutNodeDns parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/DnsInterface_name' requestBody: content: application/json: schema: $ref: '#/components/schemas/DnsUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/DnsUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no dns with that interface_name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - dns:write summary: Set the DNS resolvers of an interface tags: - Dns_API_dns_operations x-osapi-area: networking x-osapi-examples: - doc: Set the servers of an interface input: hostname: web-01 interface_name: osapi0 servers: - 9.9.9.9 - doc: Set the search domains, and keep the servers input: hostname: web-01 interface_name: osapi0 override_dhcp: true search_domains: - corp.example x-osapi-method: update /api/node/{hostname}/docker: get: description: 'Reads each container through gohai''s docker collector, which runs docker ps and docker inspect. state limits the list to the running or the stopped ones. A host whose docker does not answer reports skipped. The environment of a container shows only the names of its variables: osapi never reads their values.' operationId: GetNodeDocker parameters: - $ref: '#/components/parameters/Hostname' - description: 'Only the containers in this state: running, stopped or all, the default' in: query name: state schema: $ref: '#/components/schemas/ContainerState' x-oapi-codegen-extra-tags: validate: omitempty,enum responses: "200": content: application/json: schema: $ref: '#/components/schemas/DockerCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - docker:read summary: List the containers of the host tags: - Docker_API_docker_operations x-osapi-area: containers x-osapi-examples: - doc: A host with a container input: hostname: web-01 - doc: Only the stopped ones input: hostname: web-01 state: stopped x-osapi-method: list post: description: 'Runs docker create, which pulls the image when the host does not have it. The environment goes on docker''s standard input, not in its arguments, which each user of the host can read. auto_start starts the container once it is made. A container of the name that the host has already is not made again, and reports changed: false.' operationId: PostNodeDocker parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/DockerCreateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/DockerCreateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - docker:write summary: Create a container tags: - Docker_API_docker_operations x-osapi-area: containers x-osapi-examples: - doc: Create a container input: command: - sleep - "300" hostname: web-01 image: alpine:3.20 name: osapitest x-osapi-method: create /api/node/{hostname}/docker/{name}: delete: description: 'Runs docker rm -f, which also removes a container that runs: a delete leaves no container of the name. A container that the host does not have reports changed: false.' operationId: DeleteNodeDocker parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/DockerName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/DockerDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no docker with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - docker:write summary: Remove a container tags: - Docker_API_docker_operations x-osapi-area: containers x-osapi-examples: - doc: Remove a container input: hostname: web-01 name: osapitest x-osapi-method: delete get: description: Reads one container by its name, its ID or the start of its ID. A container that the host does not have is not found. operationId: GetNodeDockerByKey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/DockerName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/DockerGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no docker with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - docker:read summary: Get one container tags: - Docker_API_docker_operations x-osapi-area: containers x-osapi-examples: - doc: A container input: hostname: web-01 name: osapitest x-osapi-method: get /api/node/{hostname}/docker/{name}/exec: post: description: 'Runs docker exec, and answers what the command wrote to standard output and to standard error, and its exit code. A command that exits with a code other than 0 is an answer, not a failure. It changes what the command changes, which osapi cannot tell, so it reports changed: true. Its permission is docker:exec, which only the admin role gets, apart from the docker:execute of start and stop. An agent with agent.command.enabled false refuses it, as it refuses a command.' operationId: PostNodeDockerExec parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/DockerName' requestBody: content: application/json: schema: $ref: '#/components/schemas/DockerExecRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/DockerExecResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no docker with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - docker:exec summary: Run a command in a container tags: - Docker_API_docker_operations x-osapi-area: containers x-osapi-examples: - doc: Run a command input: command: - echo - hello hostname: web-01 name: osapitest x-osapi-method: exec /api/node/{hostname}/docker/{name}/start: post: description: 'Runs docker start. A container that runs already reports changed: false, and one that the host does not have is not found.' operationId: PostNodeDockerStart parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/DockerName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/DockerStartResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no docker with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - docker:execute summary: Start a container tags: - Docker_API_docker_operations x-osapi-area: containers x-osapi-examples: - doc: Start a container input: hostname: web-01 name: osapitest x-osapi-method: start /api/node/{hostname}/docker/{name}/stop: post: description: 'Runs docker stop, which waits timeout seconds before docker kills the container, or docker''s default of 10 when it is 0. A container that does not run reports changed: false.' operationId: PostNodeDockerStop parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/DockerName' requestBody: content: application/json: schema: $ref: '#/components/schemas/DockerStopRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/DockerStopResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no docker with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - docker:execute summary: Stop a container tags: - Docker_API_docker_operations x-osapi-area: containers x-osapi-examples: - doc: Stop a container input: hostname: web-01 name: osapitest timeout: 1 x-osapi-method: stop /api/node/{hostname}/file: delete: description: 'Removes the file and keeps its record, marked undeployed, so status reports unmanaged. A path that osapi did not deploy, or deleted already, does not change and reports changed: false. The object stays in the object store.' operationId: DeleteNodeFile parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/FileDeleteRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/FileDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - file:write summary: Remove a file that osapi deployed tags: - File_API_file_operations x-osapi-area: config x-osapi-examples: - doc: Remove a deployed file input: hostname: web-01 path: /etc/osapi/file-example.conf x-osapi-method: delete get: description: 'Compares the file on the host with the record that osapi keeps of what it deployed: in-sync when they agree, drifted when something changed the file, missing when osapi deployed the file and it is gone, and unmanaged when osapi did not deploy the path or undeployed it. A path that is a directory is refused.' operationId: GetNodeFile parameters: - $ref: '#/components/parameters/Hostname' - description: Absolute path of the file on the host in: query name: path required: true schema: pattern: ^/ type: string x-oapi-codegen-extra-tags: validate: required,startswith=/ responses: "200": content: application/json: schema: $ref: '#/components/schemas/FileGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - file:read summary: Show whether a deployed file holds what osapi wrote tags: - File_API_file_operations x-osapi-area: config x-osapi-examples: - doc: A deployed file input: hostname: web-01 path: /etc/osapi/file-example.conf x-osapi-method: get put: description: 'Writes the object at the path with its mode and ownership, and keeps a record of it. A template object, or content_type template, is rendered first with .Facts, .Vars and .Hostname. The record keeps the SHA-256 of the object as it was read. A file that holds the content, mode and owner already, from the same object, does not change and reports changed: false. osapi client file stale list compares the object now with that SHA-256, so it shows the deployments whose object changed since.' operationId: PutNodeFile parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/FileUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/FileUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - file:write summary: Deploy an object of the object store to a path tags: - File_API_file_operations x-osapi-area: config x-osapi-examples: - doc: Deploy a file input: hostname: web-01 object_name: example.conf path: /etc/osapi/file-example.conf - doc: Render a template input: hostname: web-01 object_name: example.conf.tmpl path: /etc/osapi/file-example.conf vars: port: "8080" x-osapi-method: update /api/node/{hostname}/group: get: description: Lists each group with its ID and its members, by name, from /etc/group through gohai, on every platform. The members are the users that /etc/group names; a user whose primary group it is is not listed again. operationId: GetNodeGroup parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/GroupCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - group:read summary: List the groups of the host tags: - Group_API_group_operations x-osapi-area: security x-osapi-examples: - doc: A host with a group input: hostname: web-01 x-osapi-method: list post: description: 'Adds the group with groupadd, with the ID when one is given. A group that the host has already does not change and reports changed: false, whatever its ID. It runs on the Debian family only, and elsewhere reports skipped.' operationId: PostNodeGroup parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/GroupCreateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/GroupCreateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - group:write summary: Add a group tags: - Group_API_group_operations x-osapi-area: security x-osapi-examples: - doc: Add a group input: hostname: web-01 name: osapitest - doc: Add a system group with its ID input: gid: 1999 hostname: web-01 name: osapitest system: true x-osapi-method: create /api/node/{hostname}/group/{name}: delete: description: 'Removes the group with groupdel. A group that the host does not have does not change and reports changed: false. It runs on the Debian family only, and elsewhere reports skipped.' operationId: DeleteNodeGroup parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/GroupName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/GroupDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no group with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - group:write summary: Remove a group tags: - Group_API_group_operations x-osapi-area: security x-osapi-examples: - doc: Remove a group input: hostname: web-01 name: osapitest x-osapi-method: delete get: description: Reads one group from the same list. A group that the host does not have is not found. operationId: GetNodeGroupByKey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/GroupName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/GroupGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no group with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - group:read summary: Get one group tags: - Group_API_group_operations x-osapi-area: security x-osapi-examples: - doc: A group input: hostname: web-01 name: developers x-osapi-method: get put: description: 'Sets the members with gpasswd -M, in place of the members that the group has. The same members, in any order, do not change it and report changed: false. A group that the host does not have is not found. It runs on the Debian family only, and elsewhere reports skipped.' operationId: PutNodeGroup parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/GroupName' requestBody: content: application/json: schema: $ref: '#/components/schemas/GroupUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/GroupUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no group with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - group:write summary: Set the members of a group tags: - Group_API_group_operations x-osapi-area: security x-osapi-examples: - doc: Set the members input: hostname: web-01 members: - root name: osapitest x-osapi-method: update /api/node/{hostname}/hostname: get: description: Reads the host's name as the hostname command prints it, on Linux and on macOS. It makes no DNS lookup. operationId: GetNodeHostname parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/HostnameGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - hostname:read summary: Get the hostname of the host tags: - Hostname_API_hostname_operations x-osapi-area: config x-osapi-examples: - doc: A host named web-01 input: hostname: web-01 x-osapi-method: get put: description: 'Sets the static hostname with hostnamectl set-hostname, which keeps it after a reboot. A host that already has the name does not change and reports changed: false. It runs on the Debian family only, and elsewhere reports skipped. In a container the runtime owns the hostname, so there it also reports skipped.' operationId: PutNodeHostname parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/HostnameUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/HostnameUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - hostname:write summary: Set the hostname of the host tags: - Hostname_API_hostname_operations x-osapi-area: config x-osapi-examples: - doc: Rename a host input: hostname: web-01 name: web-02 - doc: A host that already has the name input: hostname: web-01 name: web-01 x-osapi-method: update /api/node/{hostname}/image: get: description: Reads each image through gohai's docker collector, which runs docker images. A host whose docker does not answer reports skipped. operationId: GetNodeImage parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ImageCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - image:read summary: List the images of the host tags: - Image_API_image_operations x-osapi-area: containers x-osapi-examples: - doc: A host with an image input: hostname: web-01 x-osapi-method: list /api/node/{hostname}/image/{image}: delete: description: 'Runs docker rmi, with -f when force is set, which removes an image that a container uses. An image that the host does not have reports changed: false.' operationId: DeleteNodeImage parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ImageImage' requestBody: content: application/json: schema: $ref: '#/components/schemas/ImageDeleteRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ImageDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no image with that image. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - image:write summary: Remove an image tags: - Image_API_image_operations x-osapi-area: containers x-osapi-examples: - doc: Remove an image input: hostname: web-01 image: alpine:3.20 x-osapi-method: delete /api/node/{hostname}/image/pull: post: description: 'Runs docker pull, and answers the ID and the size of the image that the host has after it. A pull that gets nothing new, because the host had the image of that reference already, reports changed: false.' operationId: PostNodeImagePull parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/ImagePullRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ImagePullResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - image:execute summary: Pull an image tags: - Image_API_image_operations x-osapi-area: containers x-osapi-examples: - doc: Pull an image input: hostname: web-01 image: alpine:3.20 x-osapi-method: pull /api/node/{hostname}/interface: get: description: 'Reads each interface but the loopback, in the order of its index: /sys/class/net and ip on Linux, ifconfig and netstat on macOS. dhcp4 is true when a route of the interface has proto dhcp, and primary when it has the default route.' operationId: GetNodeInterface parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/InterfaceCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - interface:read summary: List the network interfaces of the host tags: - Interface_API_interface_operations x-osapi-area: networking x-osapi-examples: - doc: A Linux host input: hostname: web-01 x-osapi-method: list /api/node/{hostname}/interface/{name}: delete: description: Removes the interface's netplan file and applies what is left. netplan apply leaves the link of a dummy, so delete then deletes the link with ip link delete. An interface osapi does not configure does not change. operationId: DeleteNodeInterface parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/InterfaceName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/InterfaceDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no interface with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - interface:write summary: Drop the config osapi has of a network interface tags: - Interface_API_interface_operations x-osapi-area: networking x-osapi-examples: - doc: A dummy interface osapi configures input: hostname: web-01 name: osapi0 x-osapi-method: delete get: description: Reads the interface as list does. operationId: GetNodeInterfaceByKey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/InterfaceName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/InterfaceGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no interface with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - interface:read summary: Get a network interface of the host tags: - Interface_API_interface_operations x-osapi-area: networking x-osapi-examples: - doc: An interface with a DHCP address input: hostname: web-01 name: eth0 - doc: A Mac input: hostname: web-01 name: en0 x-osapi-method: get post: description: 'Writes a netplan file of the interface''s own, such as /etc/netplan/osapi-osapi0.yaml for osapi0, under a netplan definition that is the interface''s own, and applies it. type is ethernet, the default, or dummy. An ethernet is an interface the host has, in the netplan section that netplan status gives for it: one the host does not have is not found. A dummy goes under dummy-devices, and netplan apply makes it, so the host need not have it. dummy-devices needs netplan 0.107 or later. dhcp4 and dhcp6 are false unless given, so the interface has only the addresses given. An interface that a match defines, such as cloud-init''s all for en*, is refused, because the config would change each interface the match takes, now and later. An interface osapi already configures does not change: update replaces its config. It runs on the Debian family, and elsewhere, and in a container, reports skipped.' operationId: PostNodeInterface parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/InterfaceName' requestBody: content: application/json: schema: $ref: '#/components/schemas/InterfaceCreateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/InterfaceCreateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no interface with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - interface:write summary: Configure a network interface tags: - Interface_API_interface_operations x-osapi-area: networking x-osapi-examples: - doc: A dummy interface with a static address input: addresses: - 10.0.1.5/24 hostname: web-01 name: osapi0 type: dummy - doc: Each setting input: addresses: - 2001:db8::5/64 dhcp6: true hostname: web-01 mac_address: 52:54:00:aa:bb:cc mtu: 9000 name: osapi0 type: dummy - doc: An interface the host has input: dhcp4: true hostname: web-01 name: eth1 wakeonlan: true x-osapi-method: create put: description: 'Writes the interface''s netplan file over the one osapi has, as create writes it, and applies it. Without type dummy, the config goes in the section that netplan status gives, which is dummy-devices for a dummy, so a dummy stays a dummy. An interface osapi does not configure is not found: create configures it.' operationId: PutNodeInterface parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/InterfaceName' requestBody: content: application/json: schema: $ref: '#/components/schemas/InterfaceUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/InterfaceUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no interface with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - interface:write summary: Change the config osapi has of a network interface tags: - Interface_API_interface_operations x-osapi-area: networking x-osapi-examples: - doc: Move an interface to DHCP input: dhcp4: true hostname: web-01 name: osapi0 type: dummy x-osapi-method: update /api/node/{hostname}/interface/{name}/route: delete: description: Drops the route from the interface's netplan file and applies what is left; the last route removes the file. A route osapi does not have does not change. operationId: DeleteNodeInterfaceRoute parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/InterfaceRouteName' requestBody: content: application/json: schema: $ref: '#/components/schemas/InterfaceRouteDeleteRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/InterfaceRouteDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - interface:write summary: Drop a route that osapi wrote tags: - Route_API_route_operations x-osapi-area: networking x-osapi-examples: - doc: One of two routes input: destination: 198.51.100.0/24 hostname: web-01 name: osapi0 x-osapi-method: delete get: description: 'Reads the routes of the main table that go out of the interface: ip route on Linux, netstat on macOS. proto says where a route came from, such as dhcp, kernel or static. An interface with no routes has none; one the host does not have is not found.' operationId: GetNodeInterfaceRoute parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/InterfaceRouteName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/InterfaceRouteCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - interface:read summary: List the routes of an interface tags: - Route_API_route_operations x-osapi-area: networking x-osapi-examples: - doc: An interface with routes input: hostname: web-01 name: eth0 - doc: An interface with no routes input: hostname: web-01 name: eth1 - doc: A Mac input: hostname: web-01 name: en0 x-osapi-method: list post: description: 'Adds the route to the interface''s netplan file, such as /etc/netplan/osapi-osapi0-routes.yaml for osapi0, under a netplan definition that is the interface''s own, and applies it. A route osapi already has, the same, does not change; one to the same destination by another gateway or metric is refused: update changes it. A default route is refused: the interface behavior sets the gateway. An interface the host does not have is not found. An interface that a match defines, such as cloud-init''s all for en*, is refused, because the route would go on each interface the match takes. It runs on the Debian family, and elsewhere, and in a container, reports skipped.' operationId: PostNodeInterfaceRoute parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/InterfaceRouteName' requestBody: content: application/json: schema: $ref: '#/components/schemas/InterfaceRouteCreateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/InterfaceRouteCreateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - interface:write summary: Add a static route to an interface tags: - Route_API_route_operations x-osapi-area: networking x-osapi-examples: - doc: A route input: destination: 198.51.100.0/24 hostname: web-01 name: osapi0 via: 192.0.2.1 - doc: A second route, with a metric input: destination: 2001:db8:1::/48 hostname: web-01 metric: 200 name: osapi0 via: 2001:db8::1 x-osapi-method: create put: description: 'Writes the route over the one osapi has to the same destination, and applies it. A destination osapi has no route to is not found: create adds it.' operationId: PutNodeInterfaceRoute parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/InterfaceRouteName' requestBody: content: application/json: schema: $ref: '#/components/schemas/InterfaceRouteUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/InterfaceRouteUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - interface:write summary: Change the gateway or the metric of a route tags: - Route_API_route_operations x-osapi-area: networking x-osapi-examples: - doc: A new gateway and metric input: destination: 198.51.100.0/24 hostname: web-01 metric: 10 name: osapi0 via: 192.0.2.2 x-osapi-method: update /api/node/{hostname}/load: get: description: Reads the averages of the run queue over 1, 5 and 15 minutes. operationId: GetNodeLoad parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/LoadGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - load:read summary: Get the load averages of the host tags: - Load_API_load_operations x-osapi-area: node x-osapi-examples: - doc: A host under a light load input: hostname: web-01 x-osapi-method: get /api/node/{hostname}/log: get: description: 'Runs journalctl --output=json, the newest entries last: the last 100 unless lines says, of one unit when unit says, since a time when since says, and at a priority or above when priority says. A priority is its name, such as err or info. The hand-written log domain read the Debian family only; this reads each Linux host that has journald.' operationId: GetNodeLog parameters: - $ref: '#/components/parameters/Hostname' - description: Only the entries of this systemd unit, such as nginx.service in: query name: unit schema: pattern: ^[a-zA-Z0-9:_.@-]+$ type: string x-oapi-codegen-extra-tags: validate: omitempty,unit_name - description: How many of the newest entries; 100 when it is not set in: query name: lines schema: maximum: 10000 minimum: 1 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=1,max=10000 - description: Only the entries since this time, in any form that journalctl --since takes, such as 1 hour ago in: query name: since schema: type: string x-oapi-codegen-extra-tags: validate: omitempty - description: Only the entries at this priority or above in: query name: priority schema: $ref: '#/components/schemas/Priority' x-oapi-codegen-extra-tags: validate: omitempty,enum responses: "200": content: application/json: schema: $ref: '#/components/schemas/LogCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - log:read summary: List the entries of the journal tags: - Log_API_log_operations x-osapi-area: logs x-osapi-examples: - doc: The newest entries input: hostname: web-01 - doc: The last entry of one unit at info or above input: hostname: web-01 lines: 1 priority: info since: 1 hour ago unit: nginx.service x-osapi-method: list /api/node/{hostname}/log/source: get: description: 'Runs journalctl --field=SYSLOG_IDENTIFIER: each syslog identifier that has an entry, once, sorted. A name here is what log list takes as unit when the source is a systemd unit.' operationId: GetNodeLogSource parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/LogSourceCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - log:read summary: List the sources of the journal tags: - Source_API_source_operations x-osapi-area: logs x-osapi-examples: - doc: The sources input: hostname: web-01 x-osapi-method: list /api/node/{hostname}/memory: get: description: Reads the total, the free and the used memory, in bytes. Used is the total less what is available, which includes the cache, as free(1) reports it. operationId: GetNodeMemory parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/MemoryGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - memory:read summary: Get the memory usage of the host tags: - Memory_API_memory_operations x-osapi-area: hardware x-osapi-examples: - doc: A host with 8 GiB, 2 GiB of it free input: hostname: web-01 x-osapi-method: get /api/node/{hostname}/ntp: delete: description: 'Removes /etc/chrony/sources.d/osapi-ntp.sources and reloads the sources, so chrony uses its other sources. When osapi set no servers, it reports changed: false.' operationId: DeleteNodeNtp parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/NtpDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - ntp:write summary: Remove the NTP servers that osapi set tags: - Ntp_API_ntp_operations x-osapi-area: config x-osapi-examples: - doc: Remove the servers input: hostname: web-01 x-osapi-method: delete get: description: Reads chronyc tracking, for whether chrony is synchronized, its stratum, its offset from NTP time and the source that it follows, and chronyc sources, for each source that it has. operationId: GetNodeNtp parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/NtpGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - ntp:read summary: Get the sync status of chrony and its sources tags: - Ntp_API_ntp_operations x-osapi-area: config x-osapi-examples: - doc: A host synchronized to time.cloudflare.com input: hostname: web-01 x-osapi-method: get post: description: 'Writes a server line for each server to /etc/chrony/sources.d/osapi-ntp.sources, and reloads the sources with chronyc reload sources. A file that has the same servers does not change, and reports changed: false.' operationId: PostNodeNtp parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/NtpCreateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/NtpCreateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - ntp:write summary: Set the NTP servers that chrony uses tags: - Ntp_API_ntp_operations x-osapi-area: config x-osapi-examples: - doc: Set two servers input: hostname: web-01 servers: - 0.pool.ntp.org - 1.pool.ntp.org - doc: The servers that the host has input: hostname: web-01 servers: - 0.pool.ntp.org x-osapi-method: create put: description: 'The same as create, for servers that osapi set already. It fails with not found when osapi set none. The servers that the file has already report changed: false.' operationId: PutNodeNtp parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/NtpUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/NtpUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - ntp:write summary: Replace the NTP servers that osapi set tags: - Ntp_API_ntp_operations x-osapi-area: config x-osapi-examples: - doc: Replace the servers input: hostname: web-01 servers: - time.cloudflare.com - doc: The servers that the file has input: hostname: web-01 servers: - 0.pool.ntp.org x-osapi-method: update /api/node/{hostname}/os: get: description: 'Reads the distribution and its version: the ID and VERSION_ID of /etc/os-release on Linux, and darwin with the ProductVersion of sw_vers on macOS, such as darwin 15.5.' operationId: GetNodeOs parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/OsGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - os:read summary: Get the operating system of the host tags: - Os_API_os_operations x-osapi-area: node x-osapi-examples: - doc: An Ubuntu host input: hostname: web-01 x-osapi-method: get /api/node/{hostname}/package: get: description: 'Lists each installed package with its version: dpkg on the Debian family, rpm on the other Linux families, and Homebrew on macOS.' operationId: GetNodePackage parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/PackageCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - package:read summary: List the packages installed on the host tags: - Package_API_package_operations x-osapi-area: software x-osapi-examples: - doc: A Debian host input: hostname: web-01 x-osapi-method: list post: description: 'Installs the package with apt-get install, at the version when one is given. A package that is installed, at that version when one is given, does not change and reports changed: false. It runs on the Debian family only, and elsewhere reports skipped.' operationId: PostNodePackage parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/PackageCreateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/PackageCreateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - package:write summary: Install a package tags: - Package_API_package_operations x-osapi-area: software x-osapi-examples: - doc: Install a package input: hostname: web-01 name: tree x-osapi-method: create /api/node/{hostname}/package/{name}: delete: description: 'Removes the package with apt-get remove. A package that is not installed does not change and reports changed: false. It runs on the Debian family only, and elsewhere reports skipped.' operationId: DeleteNodePackage parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/PackageName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/PackageDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no package with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - package:write summary: Remove a package tags: - Package_API_package_operations x-osapi-area: software x-osapi-examples: - doc: Remove a package input: hostname: web-01 name: tree x-osapi-method: delete get: description: Reads one package from the same list. A package that is not installed is not found. operationId: GetNodePackageByKey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/PackageName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/PackageGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no package with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - package:read summary: Get one installed package tags: - Package_API_package_operations x-osapi-area: software x-osapi-examples: - doc: An installed package input: hostname: web-01 name: curl - doc: An installed formula input: hostname: web-01 name: jq x-osapi-method: get /api/node/{hostname}/package/updates: get: description: 'Runs apt list --upgradable: each package with its installed version and the version the index has. Refresh the index first for what the repositories have now.' operationId: GetNodePackageUpdates parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/PackageUpdatesCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - package:read summary: List the packages the index has newer versions of tags: - Updates_API_updates_operations x-osapi-area: software x-osapi-examples: - doc: Two updates input: hostname: web-01 x-osapi-method: list put: description: 'Runs apt-get update. It reports changed: true when the Release file of a repository under /var/lib/apt/lists changed, and changed: false when each repository was unchanged.' operationId: PutNodePackageUpdates parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/PackageUpdatesUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - package:write summary: Refresh the package index tags: - Updates_API_updates_operations x-osapi-area: software x-osapi-examples: - doc: The repositories are unchanged since the last refresh input: hostname: web-01 x-osapi-method: update /api/node/{hostname}/power/reboot: post: description: Runs shutdown -r -- +N, with N the delay in whole minutes and at least one, so the agent can answer before the host goes down. A message goes to the logged-in users. Each run changes the host. operationId: PostNodePowerReboot parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/PowerRebootRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/PowerRebootResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - power:execute summary: Reboot the host tags: - Power_API_power_operations x-osapi-area: node x-osapi-examples: - doc: In one minute input: hostname: web-01 - doc: In five minutes, with a message input: delay: 300 hostname: web-01 message: maintenance x-osapi-method: reboot /api/node/{hostname}/power/shutdown: post: description: Runs shutdown -h -- +N, with N the delay in whole minutes and at least one, so the agent can answer before the host goes down. A message goes to the logged-in users. Each run changes the host. operationId: PostNodePowerShutdown parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/PowerShutdownRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/PowerShutdownResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - power:execute summary: Shut the host down tags: - Power_API_power_operations x-osapi-area: node x-osapi-examples: - doc: In one minute input: hostname: web-01 - doc: In five minutes, with a message input: delay: 300 hostname: web-01 message: maintenance x-osapi-method: shutdown /api/node/{hostname}/process: get: description: 'Lists each process with its user, state, CPU and memory, its command line and when it started, through gohai: from /proc on Linux and from ps on macOS. A process that stops while the list is read is not in it.' operationId: GetNodeProcess parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ProcessCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - process:read summary: List the processes of the host tags: - Process_API_process_operations x-osapi-area: node x-osapi-examples: - doc: A Linux host that runs sleep input: hostname: web-01 x-osapi-method: list /api/node/{hostname}/process/{pid}: get: description: Reads one process by its ID, without the others. A process that the host does not have is not found. operationId: GetNodeProcessByKey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ProcessPid' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ProcessGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no process with that pid. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - process:read summary: Get one process tags: - Process_API_process_operations x-osapi-area: node x-osapi-examples: - doc: A process of a Linux host input: hostname: web-01 pid: 1234 x-osapi-method: get /api/node/{hostname}/process/{pid}/signal: post: description: 'Sends TERM, KILL, HUP, INT, USR1 or USR2 to one process with kill, and reports changed: true. A process that the host does not have is not found. A process ID below 1 is refused, because kill sends to a group of processes for 0 and for a negative ID.' operationId: PostNodeProcessSignal parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ProcessPid' requestBody: content: application/json: schema: $ref: '#/components/schemas/ProcessSignalRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ProcessSignalResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no process with that pid. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - process:execute summary: Send a signal to a process tags: - Process_API_process_operations x-osapi-area: node x-osapi-examples: - doc: Stop a process input: hostname: web-01 pid: 1234 signal: TERM x-osapi-method: signal /api/node/{hostname}/schedule: get: description: Lists each file in /etc/cron.d and in /etc/cron.hourly, daily, weekly and monthly that osapi deployed, with its object, its cron expression or interval, and its user. A cron file that osapi did not deploy is not listed. operationId: GetNodeSchedule parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ScheduleCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - schedule:read summary: List the cron entries that osapi deployed tags: - Schedule_API_schedule_operations x-osapi-area: config x-osapi-examples: - doc: An entry that osapi deployed input: hostname: web-01 x-osapi-method: list post: description: 'Gets the object from the object store and writes it as /etc/cron.d/backup for backup, mode 0644, for a cron expression, or as /etc/cron.daily/backup, mode 0755, for a daily interval. An object of content type template, or content_type template, is rendered with the agent''s facts and the vars. A file that has the content does not change. An entry of the name in a different directory does not change: move it with delete and create. A file at the path that osapi did not deploy is refused. An entry runs as its user, root included, so only admin can deploy one.' operationId: PostNodeSchedule parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/ScheduleCreateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ScheduleCreateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - schedule:write summary: Deploy a cron entry tags: - Schedule_API_schedule_operations x-osapi-area: config x-osapi-examples: - doc: An entry with a cron expression input: hostname: web-01 name: osapitest object: osapitest.cron schedule: 0 2 * * * user: root - doc: A script that runs daily input: hostname: web-01 interval: daily name: osapitest object: osapitest.sh - doc: A template, rendered with its vars input: content_type: template hostname: web-01 name: osapitest object: osapitest.tmpl schedule: 0 2 * * * vars: target: /srv x-osapi-method: create /api/node/{hostname}/schedule/{name}: delete: description: Removes the entry's file and its record. An entry that osapi did not deploy does not change, and a cron file that osapi did not deploy stays. operationId: DeleteNodeSchedule parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ScheduleName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ScheduleDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no schedule with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - schedule:write summary: Remove a cron entry that osapi deployed tags: - Schedule_API_schedule_operations x-osapi-area: config x-osapi-examples: - doc: Remove an entry input: hostname: web-01 name: osapitest x-osapi-method: delete get: description: Reads the entry from /etc/cron.d, then from each interval directory. An entry that osapi did not deploy is not found. operationId: GetNodeScheduleByKey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ScheduleName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ScheduleGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no schedule with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - schedule:read summary: Get one cron entry that osapi deployed tags: - Schedule_API_schedule_operations x-osapi-area: config x-osapi-examples: - doc: An entry that osapi deployed input: hostname: web-01 name: osapitest x-osapi-method: get put: description: 'Writes a new object, or the entry''s own, at the entry''s path, with the fields that the request gives and the entry''s own for the rest. A file that has the content does not change. An entry that osapi did not deploy is not found. The entry stays in its directory: an interval does not change with update.' operationId: PutNodeSchedule parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ScheduleName' requestBody: content: application/json: schema: $ref: '#/components/schemas/ScheduleUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ScheduleUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no schedule with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - schedule:write summary: Deploy a cron entry that osapi deployed again tags: - Schedule_API_schedule_operations x-osapi-area: config x-osapi-examples: - doc: A new object input: hostname: web-01 name: osapitest object: osapitest-v2.cron - doc: A new cron expression, with the same object input: hostname: web-01 name: osapitest schedule: 30 2 * * * - doc: A new object, cron expression and user input: hostname: web-01 name: osapitest object: osapitest-v2.cron schedule: 30 2 * * * user: nobody - doc: A daily script with a new object input: hostname: web-01 name: osapitest object: osapitest-v2.sh x-osapi-method: update /api/node/{hostname}/service: get: description: Lists each service that systemd has loaded, with its state, whether it starts at boot and its description, through gohai. A service that osapi deployed shows by the name it was deployed with, not its unit's osapi- name, and is managed. A Mac has no systemd, and reports skipped. operationId: GetNodeService parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ServiceCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - service:read summary: List the services of the host tags: - Service_API_service_operations x-osapi-area: services x-osapi-examples: - doc: A service that osapi deployed reads by its name input: hostname: web-01 x-osapi-method: list post: description: 'Gets the object from the object store and writes it as the unit file of the service, such as /etc/systemd/system/osapi-app.service for app, then reloads systemd. A unit file at that path that osapi did not write, such as the agent''s own osapi-agent.service, is refused. A unit file that already has the content does not change. The service does not start: start and enable are their own actions.' operationId: PostNodeService parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/ServiceCreateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ServiceCreateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - service:write summary: Deploy a service tags: - Service_API_service_operations x-osapi-area: services x-osapi-examples: - doc: Deploy a unit file input: hostname: web-01 name: app object: app.service x-osapi-method: create /api/node/{hostname}/service/{name}: delete: description: Stops and disables the service, removes its unit file and reloads systemd. A service with no unit file does not change. operationId: DeleteNodeService parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ServiceName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ServiceDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no service with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - service:write summary: Remove a service that osapi deployed tags: - Service_API_service_operations x-osapi-area: services x-osapi-examples: - doc: Remove a service input: hostname: web-01 name: app - doc: A unit file that osapi did not deploy input: hostname: web-01 name: agent x-osapi-method: delete get: description: Reads one service from the same list, by its name with .service or without it. A service that osapi deployed reads by the name it was deployed with, such as app, as its writes take it, or by its unit's name, osapi-app. A service that systemd has not loaded is not found. operationId: GetNodeServiceByKey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ServiceName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ServiceGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no service with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - service:read summary: Get one service tags: - Service_API_service_operations x-osapi-area: services x-osapi-examples: - doc: A running service input: hostname: web-01 name: ssh - doc: A name with .service input: hostname: web-01 name: ssh.service - doc: A service that osapi deployed, by the name it was deployed with input: hostname: web-01 name: app - doc: A service that osapi deployed, by its unit's name input: hostname: web-01 name: osapi-app x-osapi-method: get put: description: Writes the object as the unit file of a service that osapi deployed, then reloads systemd when the file changed. A service that osapi did not deploy is not found. operationId: PutNodeService parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ServiceName' requestBody: content: application/json: schema: $ref: '#/components/schemas/ServiceUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/ServiceUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no service with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - service:write summary: Deploy a new unit file for a service tags: - Service_API_service_operations x-osapi-area: services x-osapi-examples: - doc: A new unit file input: hostname: web-01 name: app object: app-v2.service x-osapi-method: update /api/node/{hostname}/service/{name}/disable: post: description: Disables the service. A service that is not enabled does not change. A service that osapi did not deploy is not found. operationId: PostNodeServiceDisable parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ServiceName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ServiceDisableResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no service with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - service:execute summary: Make a service that osapi deployed not start at boot tags: - Service_API_service_operations x-osapi-area: services x-osapi-examples: - doc: Disable the service input: hostname: web-01 name: app x-osapi-method: disable /api/node/{hostname}/service/{name}/enable: post: description: 'Enables the service. A service that is enabled does not change, and nor does a unit with no [Install] section, which systemd calls static: it cannot start at boot. A service that osapi did not deploy is not found.' operationId: PostNodeServiceEnable parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ServiceName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ServiceEnableResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no service with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - service:execute summary: Make a service that osapi deployed start at boot tags: - Service_API_service_operations x-osapi-area: services x-osapi-examples: - doc: Enable the service input: hostname: web-01 name: app - doc: A unit with no [Install] section input: hostname: web-01 name: static x-osapi-method: enable /api/node/{hostname}/service/{name}/restart: post: description: Restarts the service. It always changes the host. A service that osapi did not deploy is not found. operationId: PostNodeServiceRestart parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ServiceName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ServiceRestartResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no service with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - service:execute summary: Restart a service that osapi deployed tags: - Service_API_service_operations x-osapi-area: services x-osapi-examples: - doc: Restart the service input: hostname: web-01 name: app x-osapi-method: restart /api/node/{hostname}/service/{name}/start: post: description: Starts the service. A service that runs does not change. A service that osapi did not deploy is not found. operationId: PostNodeServiceStart parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ServiceName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ServiceStartResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no service with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - service:execute summary: Start a service that osapi deployed tags: - Service_API_service_operations x-osapi-area: services x-osapi-examples: - doc: Start the service input: hostname: web-01 name: app x-osapi-method: start /api/node/{hostname}/service/{name}/stop: post: description: Stops the service. A service that does not run does not change. A service that osapi did not deploy is not found. operationId: PostNodeServiceStop parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/ServiceName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/ServiceStopResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no service with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - service:execute summary: Stop a service that osapi deployed tags: - Service_API_service_operations x-osapi-area: services x-osapi-examples: - doc: Stop the service input: hostname: web-01 name: app x-osapi-method: stop /api/node/{hostname}/status: get: description: Runs the get of the hostname, uptime, os, load, memory and disk behaviors on the host, and answers with each. A read that fails is in errors, as its name and its error, and the other fields still answer. operationId: GetNodeStatus parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/StatusGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - status:read summary: Get the status summary of the host tags: - Status_API_status_operations x-osapi-area: node x-osapi-examples: - doc: An Ubuntu host input: hostname: web-01 x-osapi-method: get /api/node/{hostname}/sysctl: get: description: Lists every parameter the kernel shows under /proc/sys, with its current value, as sysctl -a does, and marks the ones osapi manages. A prefix, such as net.ipv4, limits the list to that part of the tree. The kernel can lack a parameter that osapi manages, for example when its module is not loaded. Then the list shows the value that osapi wrote. operationId: GetNodeSysctl parameters: - $ref: '#/components/parameters/Hostname' - description: Only this parameter and the ones under it, such as net.ipv4 in: query name: prefix schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]*$ type: string x-oapi-codegen-extra-tags: validate: omitempty,sysctl_key responses: "200": content: application/json: schema: $ref: '#/components/schemas/SysctlCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - sysctl:read summary: List the kernel's parameters and which osapi manages tags: - Sysctl_API_sysctl_operations x-osapi-area: config x-osapi-examples: - doc: Every parameter, and which osapi manages input: hostname: web-01 - doc: One part of the tree input: hostname: web-01 prefix: net.ipv4 - doc: A managed parameter the kernel does not have right now input: hostname: web-01 prefix: net.bridge x-osapi-method: list post: description: 'Writes osapi-net.ipv4.ip_forward.conf for net.ipv4.ip_forward to behaviors.sysctl.dir, /etc/sysctl.d by default, and applies it with sysctl -p. It fails when sysctl -p fails, because the value is not set. A second run with the same value changes nothing and reports changed: false. If the kernel has a different value, for example after a failed apply, it applies the value again.' operationId: PostNodeSysctl parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/SysctlCreateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/SysctlCreateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - sysctl:write summary: Manage a kernel parameter and apply it tags: - Sysctl_API_sysctl_operations x-osapi-area: config x-osapi-examples: - doc: Turn on IP forwarding input: hostname: web-01 key: net.ipv4.ip_forward value: "1" x-osapi-method: create /api/node/{hostname}/sysctl/{key}: delete: description: 'Removes the file that osapi wrote for it and reloads with sysctl --system. Then a setting for the key in a different file takes effect. If there is no such setting, the parameter keeps its current value until the next reboot. A delete of a parameter that osapi does not manage reports changed: false.' operationId: DeleteNodeSysctl parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/SysctlKey' responses: "200": content: application/json: schema: $ref: '#/components/schemas/SysctlDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no sysctl with that key. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - sysctl:write summary: Stop the management of a kernel parameter tags: - Sysctl_API_sysctl_operations x-osapi-area: config x-osapi-examples: - doc: Remove a parameter input: hostname: web-01 key: vm.swappiness x-osapi-method: delete get: operationId: GetNodeSysctlByKey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/SysctlKey' responses: "200": content: application/json: schema: $ref: '#/components/schemas/SysctlGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no sysctl with that key. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - sysctl:read summary: Get a kernel parameter's current value, and whether osapi manages it tags: - Sysctl_API_sysctl_operations x-osapi-area: config x-osapi-examples: - doc: A parameter osapi manages input: hostname: web-01 key: vm.swappiness - doc: A value of several fields input: hostname: web-01 key: net.ipv4.ping_group_range - doc: A managed parameter the kernel does not have right now input: hostname: web-01 key: net.bridge.bridge-nf-call-iptables x-osapi-method: get put: description: 'The same as create, addressed by the parameter: osapi manages the parameter from then on whether it did before or not. Setting the value it already has reports changed: false.' operationId: PutNodeSysctl parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/SysctlKey' requestBody: content: application/json: schema: $ref: '#/components/schemas/SysctlUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/SysctlUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no sysctl with that key. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - sysctl:write summary: Set a kernel parameter, manage it, and apply it tags: - Sysctl_API_sysctl_operations x-osapi-area: config x-osapi-examples: - doc: Lower swappiness input: hostname: web-01 key: vm.swappiness value: "10" x-osapi-method: update /api/node/{hostname}/timezone: get: description: 'Reads the IANA name of the timezone and its offset from UTC now: the zone that /etc/localtime links to, or /etc/timezone on Linux.' operationId: GetNodeTimezone parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/TimezoneGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - timezone:read summary: Get the timezone of the host tags: - Timezone_API_timezone_operations x-osapi-area: config x-osapi-examples: - doc: A Linux host on UTC input: hostname: web-01 x-osapi-method: get put: description: 'Sets the timezone with timedatectl set-timezone. A host that already has the timezone does not change and reports changed: false. It runs on the Debian family only, and elsewhere reports skipped.' operationId: PutNodeTimezone parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/TimezoneUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/TimezoneUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - timezone:write summary: Set the timezone of the host tags: - Timezone_API_timezone_operations x-osapi-area: config x-osapi-examples: - doc: Set a new timezone input: hostname: web-01 timezone: America/New_York - doc: A host that already has the timezone input: hostname: web-01 timezone: UTC x-osapi-method: update /api/node/{hostname}/uptime: get: description: 'Reads how long the host has run since it booted: /proc/uptime on Linux, and the boot time that sysctl gives on macOS. The uptime is in days, hours and minutes, and in seconds.' operationId: GetNodeUptime parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/UptimeGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - uptime:read summary: Get the uptime of the host tags: - Uptime_API_uptime_operations x-osapi-area: node x-osapi-examples: - doc: A host up for a day, two hours and five minutes input: hostname: web-01 x-osapi-method: get /api/node/{hostname}/user: get: description: 'Lists each user with its IDs, home, shell, groups and whether it is locked, through gohai: from /etc/passwd, /etc/group and /etc/shadow on Linux, and from the directory service with dscl on macOS. The groups are those that list the user as a member, besides its primary group.' operationId: GetNodeUser parameters: - $ref: '#/components/parameters/Hostname' responses: "200": content: application/json: schema: $ref: '#/components/schemas/UserCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - user:read summary: List the users of the host tags: - User_API_user_operations x-osapi-area: security x-osapi-examples: - doc: A host with users input: hostname: web-01 x-osapi-method: list post: description: 'Adds the user with useradd, with its home directory, and sets its password with chpasswd when one is given. The controller hashes the password, so the job and NATS have only the hash. A user that the host has already does not change and reports changed: false. It runs on the Debian family only, and elsewhere reports skipped.' operationId: PostNodeUser parameters: - $ref: '#/components/parameters/Hostname' requestBody: content: application/json: schema: $ref: '#/components/schemas/UserCreateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/UserCreateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - user:write summary: Add a user tags: - User_API_user_operations x-osapi-area: security x-osapi-examples: - doc: Add a user input: hostname: web-01 name: osapitest - doc: Add a user with a shell, groups and a password input: groups: - root hostname: web-01 name: osapitest password: '-' shell: /bin/sh - doc: Add a system user with its IDs and its home input: gid: 100 home: /home/osapitest hostname: web-01 name: osapitest system: true uid: 1999 x-osapi-method: create /api/node/{hostname}/user/{name}: delete: description: 'Removes the user and its home directory with userdel -r. A user that the host does not have does not change and reports changed: false. It runs on the Debian family only, and elsewhere reports skipped.' operationId: DeleteNodeUser parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/UserName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/UserDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no user with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - user:write summary: Remove a user tags: - User_API_user_operations x-osapi-area: security x-osapi-examples: - doc: Remove a user input: hostname: web-01 name: osapitest x-osapi-method: delete get: description: Reads one user from the same list. A user that the host does not have is not found. operationId: GetNodeUserByKey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/UserName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/UserGetResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no user with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - user:read summary: Get one user tags: - User_API_user_operations x-osapi-area: security x-osapi-examples: - doc: A user input: hostname: web-01 name: alice x-osapi-method: get put: description: 'Changes what the input gives and the user does not have already, with usermod: its shell, its home, which usermod moves the files to, its groups, which replace the groups it has, and whether it is locked. The same values report changed: false. A user that the host does not have is not found. It runs on the Debian family only, and elsewhere reports skipped.' operationId: PutNodeUser parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/UserName' requestBody: content: application/json: schema: $ref: '#/components/schemas/UserUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/UserUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host has no user with that name. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - user:write summary: Change a user tags: - User_API_user_operations x-osapi-area: security x-osapi-examples: - doc: Set the shell input: hostname: web-01 name: osapitest shell: /bin/bash - doc: Move the home, set the groups and lock it input: groups: - root home: /home/osapitest2 hostname: web-01 lock: locked name: osapitest - doc: Unlock it input: hostname: web-01 lock: unlocked name: osapitest x-osapi-method: update /api/node/{hostname}/user/{name}/password: put: description: 'Sets the password with chpasswd -e, from its hash on standard input. The controller hashes the password, so the job and NATS have only the hash. Each call makes a new hash, so it always reports changed: true. A user that the host does not have is not found. It runs on the Debian family only, and elsewhere reports skipped.' operationId: PutNodeUserPassword parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/UserPasswordName' requestBody: content: application/json: schema: $ref: '#/components/schemas/UserPasswordUpdateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/UserPasswordUpdateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - user:write summary: Set the password of a user tags: - Password_API_password_operations x-osapi-area: security x-osapi-examples: - doc: Set a password input: hostname: web-01 name: osapitest password: '-' x-osapi-method: update /api/node/{hostname}/user/{name}/sshkey: delete: description: Removes each line of the key with the fingerprint from ~/.ssh/authorized_keys of the user, and keeps the other lines as they are. A key that the file does not have, a user with no file, or a user that the host does not have, changes nothing. It runs on the Debian family only, and elsewhere reports skipped. operationId: DeleteNodeUserSshkey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/UserSshkeyName' requestBody: content: application/json: schema: $ref: '#/components/schemas/UserSshkeyDeleteRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/UserSshkeyDeleteResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - user:write summary: Remove an authorized SSH key of a user tags: - Sshkey_API_sshkey_operations x-osapi-area: security x-osapi-examples: - doc: Remove a key input: fingerprint: SHA256:mnpIO1El26FsWnOeLzppADcNXgXRNHh9MPNPLPvSCwk hostname: web-01 name: osapitest - doc: A key the user does not have input: fingerprint: SHA256:a5CeY6Lh3ZXkJOqGyuwb24kQeVjgag1gc9ujzv++nhE hostname: web-01 name: osapitest - doc: A user that the host does not have input: fingerprint: SHA256:mnpIO1El26FsWnOeLzppADcNXgXRNHh9MPNPLPvSCwk hostname: web-01 name: nobody x-osapi-method: delete get: description: Reads ~/.ssh/authorized_keys of the user through gohai, with the type, the SHA256 fingerprint, the comment and the options of each key. A user with no file has no keys. A user that the host does not have is not found. operationId: GetNodeUserSshkey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/UserSshkeyName' responses: "200": content: application/json: schema: $ref: '#/components/schemas/UserSshkeyCollectionResponse' description: Each target host's result. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - user:read summary: List the authorized SSH keys of a user tags: - Sshkey_API_sshkey_operations x-osapi-area: security x-osapi-examples: - doc: A user with keys input: hostname: web-01 name: osapitest x-osapi-method: list post: description: Adds the key line to the end of ~/.ssh/authorized_keys of the user, and makes the directory and the file if they are missing, with modes 700 and 600, owned by the user. A key that the file has already, by its fingerprint, does not change it. A line with no public key is refused. A user that the host does not have is not found. It runs on the Debian family only, and elsewhere reports skipped. operationId: PostNodeUserSshkey parameters: - $ref: '#/components/parameters/Hostname' - $ref: '#/components/parameters/UserSshkeyName' requestBody: content: application/json: schema: $ref: '#/components/schemas/UserSshkeyCreateRequest' required: true responses: "200": content: application/json: schema: $ref: '#/components/schemas/UserSshkeyCreateResponse' description: Each target host's result, with whether it changed. "400": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The request is not valid, or the host refuses the input, such as a path that is a directory. "401": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Unauthorized - API key required "403": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: Forbidden - Insufficient permissions "404": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: The host does not have what the request names, such as the object of a deploy. "409": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: osapi did not deploy the item, so it does not change it, or the host does not have a program that the method needs. "500": content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' description: An error on the controller. security: - BearerAuth: - user:write summary: Add an authorized SSH key to a user tags: - Sshkey_API_sshkey_operations x-osapi-area: security x-osapi-examples: - doc: Add a key input: hostname: web-01 key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJl85dcLw7lIdX+IyXEXT00CTCezv/2E1jvolleleo6Z osapitest@example name: osapitest - doc: Add a second key input: hostname: web-01 key: ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGLPeEZQDbhOrSIx6gISjxXIcREV3rwL517pX6m9G5jc other@example name: osapitest x-osapi-method: create components: schemas: ErrorResponse: type: object properties: error: type: string description: A description of the error that occurred. example: Failed to retrieve status. details: type: string description: Additional details about the error. example: Failed due to network timeout. reason: type: string description: 'Why the request failed, as a word that a program can branch on. The HTTP status is the class of the problem; the reason is the cause, and the error is the message for a person, which can change between releases. invalid_request: the request breaks a rule, such as a missing field (400). unauthorized: no token, or a token that is not valid (401). forbidden: the token does not have the permission (403). not_found: the host or osapi does not have what the request names (404). not_managed: the item is there, but osapi did not deploy it, so osapi does not change it (409). not_installed: the host does not have a program that the request needs (409). conflict: the state of the item blocks the request, such as a create of one that exists (409). unavailable: a part that osapi depends on is down, such as NATS (503). server_error: the controller failed; its log has the cause (500).' enum: - invalid_request - unauthorized - forbidden - not_found - not_managed - not_installed - conflict - unavailable - server_error example: not_found Admission: properties: admitted_at: description: When the node was admitted. format: date-time type: string decided_at: description: When the node was rejected or revoked. format: date-time type: string encryption_key: description: The node's public X25519 encryption key, which the fingerprint covers. example: XA7NTLWJ2ECILFDLHORNVYROXOK65ONQ2SJYHRNAWRJZ3UXMVXIGUVJM type: string fingerprint: description: 'The fingerprint of the node''s two public keys: signing and encryption.' example: SHA256:1f53dea6dba17ae38388b931df5c6370076c8236018d6e8a2adecc8474ae93ef type: string hostname: description: The hostname the node gave. example: web-01 type: string join_token: description: On an admitted record that a join made, the ID of the join token that admitted the node. type: string last_seen: description: When the node last reported. format: date-time type: string machine_id: description: The machine ID of the node. example: d530664edc1c431eb5ef1e9dfd6617a5 type: string online: description: 'Whether the node is running now: it is in the registry.' type: boolean previous: $ref: '#/components/schemas/AdmissionState' previous_fingerprint: description: On a pending record, the fingerprint of the earlier record; a different one is a new key. type: string reason: description: Why the node was rejected. type: string requested_at: description: When the node asked to join. format: date-time type: string state: $ref: '#/components/schemas/AdmissionState' required: - machine_id - hostname - state - online - fingerprint type: object AdmissionState: description: 'The state of a node''s admission record: pending, admitted, rejected or revoked.' enum: - pending - admitted - rejected - revoked type: string AdmitRequest: properties: fingerprint: description: The fingerprint that osapi agent key fingerprint prints on the machine. example: SHA256:1f53dea6dba17ae38388b931df5c6370076c8236018d6e8a2adecc8474ae93ef maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 required: - fingerprint type: object ListAdmissionResponse: properties: items: description: The admission records, in hostname order. items: $ref: '#/components/schemas/Admission' type: array total_items: description: The number of records. example: 3 type: integer required: - total_items - items type: object RejectRequest: properties: reason: description: Why the machine is rejected; the machine and the record keep it. example: unknown host maxLength: 1024 type: string x-oapi-codegen-extra-tags: validate: omitempty,max=1024 type: object AddressFamily: description: AddressFamily is the IP address family of an interface. enum: - inet - inet6 - dual type: string AgentConfigRequest: properties: labels: additionalProperties: type: string description: The labels of the agent, as key=value. They replace the labels of the agent's config file with the same keys. Empty removes each. type: object x-oapi-codegen-extra-tags: validate: omitempty type: object AgentConfigResponse: properties: labels: additionalProperties: type: string description: The labels that the controller gives the agent. type: object updated_at: description: When the config last changed. format: date-time type: string version: description: One more at each change; 0 when nothing was set. type: integer required: - version type: object AgentInfo: properties: architecture: description: CPU architecture. example: amd64 type: string conditions: description: The conditions that hold now, such as HighLoad. A condition that does not hold is not in the list. items: $ref: '#/components/schemas/NodeCondition' type: array config_behind: description: 'The agent has not applied the newest config that the controller holds for it yet: it applies it at its next heartbeat, or it cannot reach the controller''s config.' type: boolean config_version: description: The version of the controller's config of the agent that the agent applied. Absent when it applied none. example: 2 type: integer config_wanted: description: The version of the config that the controller holds for the agent. Absent when it holds none. example: 3 type: integer cpu_count: description: Number of logical CPUs. example: 4 type: integer facts: additionalProperties: true description: Extended facts from additional providers. type: object fingerprint: description: The SHA256 fingerprint of the agent's PKI public key. Empty until the agent loads its keys. type: string fqdn: description: Fully qualified domain name. example: web-01.example.com type: string hostname: description: The hostname of the agent. type: string interfaces: items: $ref: '#/components/schemas/NetworkInterfaceResponse' type: array kernel_version: description: OS kernel version. example: 5.15.0-91-generic type: string key_stored: description: Whether the controller holds this agent's public key, recorded when its enrollment was accepted. False for an agent that has not enrolled since the key store existed, which is what to re-enrol before enabling enforcement. type: boolean labels: additionalProperties: type: string description: Key-value labels configured on the agent. type: object load_average: $ref: '#/components/schemas/LoadAverageResponse' machine_id: description: The permanent machine identifier. type: string memory: $ref: '#/components/schemas/MemoryResponse' missing_programs: description: The programs that the agent's behaviors declare and that the host lacks. A behavior fails until its program is installed. items: type: string type: array os_info: $ref: '#/components/schemas/OSInfoResponse' package_mgr: description: Package manager. example: apt type: string primary_interface: description: Name of the interface used for the default route. example: eth0 type: string registered_at: description: When the agent last refreshed its heartbeat. format: date-time type: string routes: description: Network routing table entries. items: $ref: '#/components/schemas/RouteResponse' type: array service_mgr: description: Init system. example: systemd type: string started_at: description: When the agent process started. format: date-time type: string state: $ref: '#/components/schemas/AgentState' timeline: description: Agent state transition history. items: $ref: '#/components/schemas/TimelineEvent' type: array uptime: description: The system uptime. type: string verified: description: Whether this agent's registration was signed by its stored key and claims the hostname it enrolled under. Only a verified registration decides where work is routed. True when the controller is not enforcing verification. type: boolean version: description: The build version of the agent binary. Absent for an agent that does not report it. example: v1.4.0 type: string required: - hostname - state type: object AgentState: description: 'The scheduling state of an agent: Ready, Draining, Cordoned or Pending. A drain that the agent has not applied yet is Draining.' enum: - Ready - Draining - Cordoned - Pending - Refused type: string ConditionType: description: A condition that an agent or a component evaluates. enum: - MemoryPressure - HighLoad - DiskPressure - DrainStuck - ConsumersUnavailable - ProcessMemoryPressure - ProcessHighCPU - KeyMismatch type: string FactKeyEntry: properties: builtin: description: Whether this is a built-in fact key. type: boolean description: description: Human-readable description of the fact. type: string key: description: The fact key, such as 'interface.primary'. type: string required: - key type: object FactKeysResponse: properties: items: description: Available fact keys for @fact. references. items: $ref: '#/components/schemas/FactKeyEntry' type: array total_items: description: Total number of fact keys. type: integer required: - items - total_items type: object JoinRequest: properties: encryption_key: description: The agent's X25519 encryption key, in the nkeys form. maxLength: 128 type: string x-oapi-codegen-extra-tags: validate: required,max=128 hostname: description: The hostname of the host. maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 machine_id: description: The machine ID of the host. maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 public_key: description: The agent's Ed25519 signing key, in base64. format: byte maxLength: 128 type: string x-oapi-codegen-extra-tags: validate: required,max=128,base64 signature: description: The signature of the request by the signing key, in base64. format: byte maxLength: 256 type: string x-oapi-codegen-extra-tags: validate: required,max=256,base64 token: description: 'The join token, osapi_jt_., from osapi controller join token create. A secret: a reference, secret:///, or the value.' format: password maxLength: 256 type: string writeOnly: true x-oapi-codegen-extra-tags: validate: required,max=256 x-osapi-secret: true required: - token - machine_id - hostname - public_key - encryption_key - signature type: object JoinResponse: properties: controller_public_key: description: The controller's Ed25519 public key, in base64, which the agent keeps and checks each job with. type: string required: - controller_public_key type: object ListAgentsResponse: properties: items: description: The active agents. items: $ref: '#/components/schemas/AgentInfo' type: array total_items: description: Total number of active agents. type: integer required: - items - total_items type: object LoadAverageResponse: description: The system load averages for 1, 5, and 15 minutes. properties: 1min: description: Load average for the last 1 minute. example: 0.32 type: number 5min: description: Load average for the last 5 minutes. example: 0.28 type: number 15min: description: Load average for the last 15 minutes. example: 0.25 type: number required: - 1min - 5min - 15min type: object MemoryResponse: description: Memory usage information. properties: free: description: Free memory in bytes. example: 2097152 type: integer total: description: Total memory in bytes. example: 8388608 type: integer used: description: Used memory in bytes. example: 4194304 type: integer required: - total - free - used type: object NetworkInterfaceResponse: properties: family: $ref: '#/components/schemas/AddressFamily' ipv4: example: 192.168.1.10 type: string ipv6: example: fe80::1 type: string mac: example: "00:11:22:33:44:55" type: string name: example: eth0 type: string required: - name type: object NodeCondition: properties: last_transition_time: format: date-time type: string reason: type: string type: $ref: '#/components/schemas/ConditionType' required: - type - last_transition_time type: object OSInfoResponse: description: Operating system information. properties: distribution: description: The name of the Linux distribution. example: Ubuntu type: string family: description: 'The platform family that the agent picks providers by, as gohai names it: debian, suse, darwin and so on. A method runs on a host whose family is one of its platforms.' example: debian type: string version: description: The version of the Linux distribution. example: "20.04" type: string required: - distribution - version type: object RouteResponse: description: A network routing table entry. properties: destination: description: Destination network address. example: 0.0.0.0 type: string gateway: description: Gateway address. example: 192.168.1.1 type: string interface: description: Network interface name. example: eth0 type: string mask: description: Network mask in CIDR notation. example: /0 type: string metric: description: Route metric. example: 100 type: integer required: - destination - gateway - interface type: object TimelineEvent: properties: error: type: string event: type: string hostname: type: string message: type: string timestamp: format: date-time type: string required: - timestamp - event type: object AuditEntry: properties: action: description: What a change that did not go through the API did, such as agent.admit or jointoken.create. example: agent.admit type: string actor: description: 'The kind of who made a change that did not go through the API: system, join-token, agent or local. Absent for a request through the API.' example: system type: string chain: description: 'The steps on one line for each host, such as web-01: managedfile update (changed).' items: type: string type: array duration_ms: description: Request duration in milliseconds. example: 42 format: int64 type: integer id: description: Unique identifier for the audit entry. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid job_id: description: The job this request created, absent when it created none. Joins the entry to that job's own status timeline. example: 7c9e6679-7425-40de-944b-e07fc1f90ae7 type: string method: description: HTTP method. example: GET type: string operation_id: description: OpenAPI operation ID. example: GetNodeHostname type: string path: description: Request URL path. example: /node/hostname type: string request_summary: description: What the request asked for, with sensitive values replaced. Recorded for methods that change something. example: '{"command":"systemctl","args":["restart","nginx"]}' type: string response_code: description: HTTP response status code. example: 200 type: integer roles: description: Roles from the JWT token. items: type: string type: array source_ip: description: Client IP address. example: 192.168.1.100 type: string steps: description: The calls of other behaviors that the method of the job made, for each host that answered before the request returned, also when one failed. Absent when no host made a call. items: properties: hostname: description: The host that answered the job. type: string steps: description: The calls, in the order that the method made them. items: $ref: '#/components/schemas/Step' type: array required: - hostname - steps type: object type: array target: description: What the action was on, such as a machine ID or a join token's ID. example: 5f3c9a2b8d7e4f60a1b2c3d4e5f60718 type: string targets: description: The target scope of the JWT token, absent when the token acts on each host. items: type: string type: array timestamp: description: When the request was processed. example: "2026-02-21T10:30:00Z" format: date-time type: string trace_id: description: OpenTelemetry trace ID for correlation. example: 4bf92f3577b34da6a3ce929d0e0e4736 type: string user: description: 'Who did it: the authenticated user (JWT subject), or the name of another actor.' example: ops@example.com type: string required: - id - timestamp - user - roles - method - path - response_code - duration_ms - source_ip type: object AuditEntryResponse: properties: entry: $ref: '#/components/schemas/AuditEntry' required: - entry type: object ListAuditResponse: properties: items: description: The audit entries for this page. items: $ref: '#/components/schemas/AuditEntry' type: array total_items: description: Total number of audit entries. example: 150 type: integer required: - total_items - items type: object Step: properties: behavior: type: string changed: type: boolean duration_ms: format: int64 type: integer error: type: string method: type: string steps: items: $ref: '#/components/schemas/Step' type: array required: - behavior - method - duration_ms type: object CatalogArea: properties: label: description: The label of the area. example: Networking type: string name: description: The name of the area. example: networking type: string required: - name - label type: object CatalogBehavior: properties: area: description: The area of the behavior, or empty for an internal behavior. example: networking type: string chain: description: The chain of the behavior, as osapi dsl chain list prints it. type: string doc: description: What the behavior manages. type: string internal: description: 'Only other behaviors call it: it has no route.' type: boolean methods: description: The methods of the behavior. items: $ref: '#/components/schemas/CatalogMethod' type: array name: description: The name of the behavior. example: dns type: string parent: description: The behavior that the behavior is under, such as user for sshkey. type: string platforms: description: The platforms of the providers of the behavior. items: type: string type: array title: description: The title of the behavior. example: DNS type: string used_by: description: The behaviors that call the behavior. items: type: string type: array uses: description: The behaviors that the behavior calls. items: type: string type: array required: - name - title - area - doc - internal - platforms - uses - used_by - chain - methods type: object CatalogCall: properties: behavior: description: The behavior that is called. example: package type: string calls: description: The calls that the call makes. items: $ref: '#/components/schemas/CatalogCall' type: array method: description: The method that is called. example: get type: string required: - behavior - method type: object CatalogColumn: properties: columns: description: The columns of an object, or of a list of objects. items: $ref: '#/components/schemas/CatalogColumn' type: array doc: description: What the field is. type: string kind: $ref: '#/components/schemas/ColumnKind' label: description: The label of the field. example: Total type: string name: description: The json name of the field. example: total type: string render: description: The render tag of the field, such as bytes. example: bytes type: string required: - name - label - doc - kind type: object CatalogControllerMethod: properties: doc: description: What the method does, in one line. type: string group: description: The endpoint group. example: file type: string method: description: The method. example: list type: string operation: $ref: '#/components/schemas/OperationID' permission: $ref: '#/components/schemas/Permission' required: - group - method - doc - operation - permission type: object CatalogExample: properties: doc: description: What the example does. type: string input: description: The input of the example. output: description: The output of the example. required: - doc - input type: object CatalogField: properties: doc: description: What the field is. type: string in: $ref: '#/components/schemas/FieldIn' kind: $ref: '#/components/schemas/FieldKind' name: description: The json name of the field. example: servers type: string options: description: 'The values that the field takes: those of its type with enum, or of its oneof rule.' items: type: string type: array required: description: The request needs the field. type: boolean secret: description: The field is a secret. type: boolean required: - name - in - kind - required - doc type: object CatalogMethod: properties: calls: description: The calls that the examples of the method make to other behaviors. items: $ref: '#/components/schemas/CatalogCall' type: array columns: description: The fields of the rows that the method answers, as the CLI's output reads them. items: $ref: '#/components/schemas/CatalogColumn' type: array disruption: description: What the method interrupts. type: string disruptive: description: The method can interrupt a host, such as a reboot. type: boolean doc: description: What the method does. type: string examples: description: The examples of the method. items: $ref: '#/components/schemas/CatalogExample' type: array fields: description: The fields of the input. items: $ref: '#/components/schemas/CatalogField' type: array http_method: description: The HTTP method of the route. An internal behavior has no route. example: PUT type: string input: description: The input type and its fields, a required one marked *. type: string kind: $ref: '#/components/schemas/MethodKind' long: description: The rest of what the method does. type: string name: description: The name of the method. example: update type: string output: description: The output type and its fields. type: string path: description: The path of the route. type: string permission: $ref: '#/components/schemas/Permission' platforms: description: 'The platforms that the method runs on: those that its On limits it to, else each platform of the behavior.' items: type: string type: array runs_on: description: The host platforms that the method runs on, as the agent decides, and * for a Linux host whose platform gohai has no family for. items: type: string type: array required: - name - kind - doc - platforms - runs_on - input - output - fields - columns - calls - examples type: object CatalogOperation: properties: id: $ref: '#/components/schemas/OperationID' permission: $ref: '#/components/schemas/Permission' required: - id - permission type: object CatalogResponse: properties: areas: description: Each area, in order, with its label. items: $ref: '#/components/schemas/CatalogArea' type: array behaviors: description: Each behavior that the API serves, and each internal behavior, in the order of the registry. items: $ref: '#/components/schemas/CatalogBehavior' type: array controller: description: 'Each method of an endpoint group of the Object Store area: a call of the controller that takes no target.' items: $ref: '#/components/schemas/CatalogControllerMethod' type: array count_tones: additionalProperties: type: string description: 'The tone of a count above zero, by what it counts: ok, warn or err.' type: object host_families: description: The host platforms that gohai names. A method's runs_on has * for any other Linux. items: type: string type: array operations: description: The permission of each operation that needs one, in the order of the operationIds. items: $ref: '#/components/schemas/CatalogOperation' type: array outcomes: description: The outcomes of a host, from the best to the worst, as the CLI's summary orders them. items: type: string type: array permissions: description: Each permission that osapi knows. items: $ref: '#/components/schemas/Permission' type: array render_tags: description: The render tags of an output field, as the CLI reads them. short= takes a number, such as short=12. items: type: string type: array roles: description: The built-in roles, in order, with the permissions of each. items: $ref: '#/components/schemas/CatalogRole' type: array status_tones: additionalProperties: type: string description: 'The tone of each status word, as the CLI colors it: ok, warn or err.' type: object targets: description: 'The targets that name no host: each agent, or any one agent.' items: $ref: '#/components/schemas/CatalogTarget' type: array required: - behaviors - areas - permissions - roles - operations - status_tones - count_tones - host_families - targets - controller - render_tags - outcomes type: object CatalogRole: properties: description: description: Who the role is for. type: string name: description: The name of the role, as a token names it. example: operator type: string permissions: description: The permissions of the role. items: $ref: '#/components/schemas/Permission' type: array required: - name - description - permissions type: object CatalogTarget: properties: doc: description: What it sends the job to. type: string label: description: Its label. example: All agents type: string value: description: The target, as a method takes it. example: _all type: string required: - value - label - doc type: object ColumnKind: description: ColumnKind is what a field of an answer holds. enum: - value - values - object - list type: string FieldIn: description: FieldIn is where a field of a request goes. enum: - path - query - body type: string FieldKind: description: FieldKind is how a form takes the value of a field. enum: - string - number - bool - list - object type: string MethodKind: description: 'What a method does to a host, by the verb of its permission: read, write or action.' enum: - read - write - action type: string OperationID: description: An operationId of an operation that needs a permission. enum: - AdmitMachine - DeleteFileByName - DeleteJobByID - DeleteMachine - DeleteNodeCertificate - DeleteNodeDns - DeleteNodeDocker - DeleteNodeFile - DeleteNodeGroup - DeleteNodeImage - DeleteNodeInterface - DeleteNodeInterfaceRoute - DeleteNodeNtp - DeleteNodePackage - DeleteNodeSchedule - DeleteNodeService - DeleteNodeSysctl - DeleteNodeUser - DeleteNodeUserSshkey - DeleteSecret - DrainAgent - GetAdmission - GetAdmissions - GetAgentConfig - GetAgentDetails - GetAgentFacts - GetAgents - GetAuditExport - GetAuditLogByID - GetAuditLogs - GetCatalog - GetFileByName - GetFileStale - GetFiles - GetHealthStatus - GetJobByID - GetJobs - GetNodeCertificate - GetNodeCertificateByKey - GetNodeDisk - GetNodeDnsByKey - GetNodeDocker - GetNodeDockerByKey - GetNodeFile - GetNodeGroup - GetNodeGroupByKey - GetNodeHostname - GetNodeImage - GetNodeInterface - GetNodeInterfaceByKey - GetNodeInterfaceRoute - GetNodeLoad - GetNodeLog - GetNodeLogSource - GetNodeMemory - GetNodeNtp - GetNodeOs - GetNodePackage - GetNodePackageByKey - GetNodePackageUpdates - GetNodeProcess - GetNodeProcessByKey - GetNodeSchedule - GetNodeScheduleByKey - GetNodeService - GetNodeServiceByKey - GetNodeStatus - GetNodeSysctl - GetNodeSysctlByKey - GetNodeTimezone - GetNodeUptime - GetNodeUser - GetNodeUserByKey - GetNodeUserSshkey - GetSecret - GetSecretValue - GetSecretVaults - GetSecrets - GetTrace - PostFile - PostNodeCertificate - PostNodeCommandExec - PostNodeCommandShell - PostNodeConnectivityPing - PostNodeDocker - PostNodeDockerExec - PostNodeDockerStart - PostNodeDockerStop - PostNodeGroup - PostNodeImagePull - PostNodeInterface - PostNodeInterfaceRoute - PostNodeNtp - PostNodePackage - PostNodePowerReboot - PostNodePowerShutdown - PostNodeProcessSignal - PostNodeSchedule - PostNodeService - PostNodeServiceDisable - PostNodeServiceEnable - PostNodeServiceRestart - PostNodeServiceStart - PostNodeServiceStop - PostNodeSysctl - PostNodeUser - PostNodeUserSshkey - PutAgentConfig - PutFileByName - PutNodeCertificate - PutNodeDns - PutNodeFile - PutNodeGroup - PutNodeHostname - PutNodeInterface - PutNodeInterfaceRoute - PutNodeNtp - PutNodePackageUpdates - PutNodeSchedule - PutNodeService - PutNodeSysctl - PutNodeTimezone - PutNodeUser - PutNodeUserPassword - PutSecret - RejectMachine - RetryJobByID - RevokeMachine - UndrainAgent type: string Permission: description: A permission that osapi knows, as resource:verb. enum: - health:read - trace:read - secret:use - secret:reveal - certificate:read - certificate:write - command:execute - command:shell - connectivity:execute - disk:read - dns:read - dns:write - docker:read - docker:write - docker:execute - docker:exec - file:read - file:write - group:read - group:write - hostname:read - hostname:write - image:read - image:execute - image:write - interface:read - interface:write - load:read - log:read - memory:read - ntp:read - ntp:write - os:read - package:read - package:write - power:execute - process:read - process:execute - schedule:read - schedule:write - service:read - service:write - service:execute - status:read - sysctl:read - sysctl:write - timezone:read - timezone:write - uptime:read - user:read - user:write - admission:read - admission:write - agent:read - agent:write - audit:read - catalog:read - job:read - job:write - secret:read - secret:write type: string ContentType: description: 'ContentType is how a deploy treats a file: raw writes its bytes as they are; template renders it with Go text/template and the agent''s facts.' enum: - raw - template type: string FileInfo: properties: content_type: $ref: '#/components/schemas/ContentType' name: description: The name of the file. example: nginx.conf type: string sha256: description: SHA-256 hash of the file content. example: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 type: string size: description: File size in bytes. example: 1024 type: integer source: description: 'Source of the file: ''system'' or ''user''.' example: user type: string required: - name - sha256 - size - content_type - source type: object FileInfoResponse: properties: content_type: $ref: '#/components/schemas/ContentType' name: description: The name of the file. example: nginx.conf type: string sha256: description: SHA-256 hash of the file content. example: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 type: string size: description: File size in bytes. example: 1024 type: integer required: - name - sha256 - size - content_type type: object FileListResponse: properties: items: description: List of stored files. items: $ref: '#/components/schemas/FileInfo' type: array total_items: description: Total number of files. example: 5 type: integer required: - items - total_items type: object FileUploadResponse: properties: changed: description: Whether the file content changed. False when the Object Store already held an object with the same SHA-256 digest. example: true type: boolean content_type: $ref: '#/components/schemas/ContentType' name: description: The name of the uploaded file. example: nginx.conf type: string sha256: description: SHA-256 hash of the file content. example: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 type: string size: description: File size in bytes. example: 1024 type: integer required: - name - sha256 - size - changed - content_type type: object StaleDeployment: properties: current_sha: description: SHA-256 hash of the current object store content. example: 789abc012def type: string deployed_at: description: When the file was last deployed. example: "2026-04-01T18:00:00Z" type: string deployed_sha: description: SHA-256 of the object when it was deployed. example: abc123def456 type: string hostname: description: Host where the file is deployed. example: web-01 type: string object_name: description: Name of the object in the Object Store. example: hello-echo type: string path: description: Deployment path on the target host. example: /etc/systemd/system/osapi-hello-echo.service type: string provider: description: Provider that manages this deployment. example: service type: string required: - object_name - hostname - provider - deployed_at - path - deployed_sha - current_sha type: object StaleDeploymentsResponse: properties: items: description: The stale deployments. items: $ref: '#/components/schemas/StaleDeployment' type: array total_items: description: Total number of stale deployments. type: integer required: - items - total_items type: object AgentDetail: properties: hostname: description: Agent hostname. example: web-01 type: string labels: description: Formatted label string. example: group=web.prod type: string registered: description: Time since last heartbeat registration. example: 15s ago type: string required: - hostname - registered type: object AgentStats: properties: agents: description: Per-agent registration details. items: $ref: '#/components/schemas/AgentDetail' type: array ready: description: Number of agents with Ready status. example: 5 type: integer total: description: Total number of registered agents. example: 5 type: integer required: - total - ready type: object Check: properties: error: description: Why the check failed. Absent when it is ok. type: string name: description: What was checked, such as nats. example: nats type: string status: description: ok, or error. example: ok type: string required: - name - status type: object ComponentEntry: properties: address: description: Listen address of a sub-component, such as :8080. type: string age: description: Time since component started. example: 7h 6m type: string components: description: The sub-components of the component, such as its api and its metrics server, sorted by name. items: $ref: '#/components/schemas/ComponentEntry' type: array conditions: description: Active conditions. items: $ref: '#/components/schemas/ConditionType' type: array cpu_percent: description: Process CPU usage percentage. example: 2.1 type: number hostname: description: Component hostname. example: web-01 type: string mem_bytes: description: Process RSS memory in bytes. example: 134217728 format: int64 type: integer status: description: Component status. example: Ready type: string type: description: Component type (agent, controller, nats), or the name of a sub-component, such as api. example: agent type: string url: description: Where a person opens a sub-component, from its url config key. type: string version: description: Build version of the component's binary. example: v0.2.1-0.20261119003517-f6bc5af55ceb type: string type: object ComponentType: description: ComponentType is the type of a part of osapi that reports its health. enum: - controller - nats - agent type: string HealthResponse: properties: status: description: Health status. example: ok type: string required: - status type: object JobStats: properties: completed: description: Number of completed jobs. example: 90 type: integer dlq: description: Number of jobs in the dead letter queue. example: 0 type: integer failed: description: Number of failed jobs. example: 3 type: integer processing: description: Number of jobs currently processing. example: 2 type: integer submitted: description: Number of jobs that no agent has taken. example: 5 type: integer total: description: Total number of jobs. example: 100 type: integer required: - total - submitted - processing - completed - failed - dlq type: object KVBucketInfo: properties: bytes: description: Total bytes in the bucket. example: 2048 type: integer keys: description: Number of keys in the bucket. example: 10 type: integer name: description: KV bucket name. example: job-queue type: string required: - name - keys - bytes type: object NATSInfo: properties: url: description: Connected NATS server URL. example: nats://localhost:4222 type: string version: description: NATS server version. example: 2.10.0 type: string required: - url - version type: object ObjectStoreInfo: properties: name: description: Object Store bucket name. example: file-objects type: string size: description: Total bytes in the store. example: 5242880 type: integer required: - name - size type: object ReadyResponse: properties: error: description: Error message when not ready. type: string status: description: Readiness status. example: ready type: string required: - status type: object StatusResponse: properties: agents: $ref: '#/components/schemas/AgentStats' checks: description: 'What the controller that answered checked for this answer: its connection to NATS and to the KV store.' items: $ref: '#/components/schemas/Check' type: array consumers: description: 'Total number of JetStream consumers: the sum of the consumers of each stream.' type: integer jobs: $ref: '#/components/schemas/JobStats' kv_buckets: description: KV bucket statistics. items: $ref: '#/components/schemas/KVBucketInfo' type: array nats: $ref: '#/components/schemas/NATSInfo' object_stores: description: Object Store statistics. items: $ref: '#/components/schemas/ObjectStoreInfo' type: array registry: description: All registered components with health details, each with its sub-components. items: $ref: '#/components/schemas/ComponentEntry' type: array status: description: Overall health status. example: ok type: string streams: description: JetStream stream statistics. items: $ref: '#/components/schemas/StreamInfo' type: array uptime: description: Time since server started. example: 2h30m type: string version: description: Application version. example: 0.1.0 type: string required: - status - version - uptime - checks - consumers type: object StreamInfo: properties: bytes: description: Total bytes in the stream. example: 1024 type: integer consumers: description: Number of consumers on the stream. example: 1 type: integer messages: description: Number of messages in the stream. example: 42 type: integer name: description: Stream name. example: JOBS type: string required: - name - messages - bytes - consumers type: object AgentJobStatus: description: The status of a job on one host. The controller records submitted and retried; an agent records acknowledged, started, completed, failed or skipped; and timeout is a host whose agent did not answer in time. enum: - submitted - acknowledged - started - completed - failed - skipped - retried - timeout - refused type: string CreateJobResponse: properties: job_id: description: Unique identifier for the created job. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid revision: description: The KV revision number. example: 1 format: int64 type: integer status: $ref: '#/components/schemas/JobStatus' timestamp: description: Creation timestamp. example: "2025-06-14T10:00:00Z" type: string required: - job_id - status type: object JobDetailResponse: properties: agent_states: description: How far each agent got, by hostname. items: properties: duration: type: string error: type: string hostname: type: string status: $ref: '#/components/schemas/AgentJobStatus' required: - hostname type: object type: array chain: description: 'The calls of other behaviors that the method made on each host, one line for each host, such as web-01: netplan update (changed) → managedfile update (changed).' items: type: string type: array changed: description: Whether the operation modified system state. Null for pending/failed jobs; true/false for completed jobs. type: boolean created: description: Creation timestamp. type: string error: description: Error message if failed. type: string hostname: description: Agent hostname that processed the job. type: string id: description: Unique identifier of the job. format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid operation: description: What the job asked for, with each secret masked. properties: data: description: The data of the operation, with each secret masked. type: description: The operation, such as node.hostname.get. type: string required: - type type: object responses: description: What each agent answered, by hostname. items: properties: changed: type: boolean data: description: Agent result data. error: type: string hostname: type: string status: $ref: '#/components/schemas/AgentJobStatus' steps: description: The calls of other behaviors that the method made on the host, also when one failed. items: $ref: '#/components/schemas/Step' type: array required: - hostname type: object type: array result: description: The result data if completed. status: $ref: '#/components/schemas/JobStatus' target: description: 'The target the request gave: _any, _all, a hostname, or a label such as group:web.dev. A job stored before targets were kept has the host that answered.' type: string timeline: description: Chronological sequence of job lifecycle events. items: properties: error: description: Error details if applicable. type: string event: $ref: '#/components/schemas/AgentJobStatus' hostname: description: Agent or source that generated the event. type: string message: description: Human-readable description of the event. type: string timestamp: description: ISO 8601 timestamp of the event. type: string type: object type: array updated_at: description: Last update timestamp. type: string type: object JobStatus: description: 'The status of a job, which the controller computes from what each agent did: submitted, processing, completed, failed, partial_failure (completed on some agents and failed on others) or skipped (each agent skipped it).' enum: - submitted - processing - completed - failed - partial_failure - skipped type: string ListJobsResponse: properties: items: items: $ref: '#/components/schemas/JobDetailResponse' type: array status_counts: additionalProperties: type: integer description: Count of all jobs by status. Derived from key names during the listing pass, with no extra reads. example: completed: 30 failed: 3 partial_failure: 2 processing: 2 submitted: 5 type: object total_items: description: Total number of jobs matching the filter. example: 42 type: integer type: object RetryJobRequest: properties: target_hostname: default: _any description: 'The target of the retried job: _any, _all, a hostname, or a label such as group:web.dev.' example: _any minLength: 1 type: string x-oapi-codegen-extra-tags: validate: omitempty,min=1,valid_target type: object SecretInfo: properties: by: description: Who did the last update, or empty when it is not known. example: ops@example.com type: string changed: description: When the last update occurred. example: "2026-11-23T22:56:50Z" format: date-time type: string key: description: The name of the key. example: registry-token type: string vault: description: The name of the vault. example: default type: string version: description: 1 for the first value of the key, and one more for each update. example: 3 format: int64 type: integer required: - vault - key - version - changed - by type: object SecretListResponse: properties: items: description: The keys of the vault, sorted by key. items: $ref: '#/components/schemas/SecretInfo' type: array total_items: description: The number of keys. example: 1 type: integer required: - items - total_items type: object SecretUpdateRequest: properties: value: description: 'The value of the key, which no method gives back. A secret: a reference, secret:///, or the value.' format: password maxLength: 65536 type: string writeOnly: true x-oapi-codegen-extra-tags: validate: required,max=65536 x-osapi-secret: true required: - value type: object SecretValue: properties: value: description: The value of the key. example: glpat-xxxxxxxxxxxxxxxxxxxx type: string required: - value type: object VaultInfo: properties: answers: description: Whether the vault answered a list of its keys. example: true type: boolean name: description: The name of the vault, as a reference gives it. example: default type: string targets: description: The targets that its secrets can go to. Empty is each host. items: type: string type: array type: description: The type of the vault, such as nats. example: nats type: string required: - name - type - targets - answers type: object VaultListResponse: properties: items: description: The vaults of the controller. items: $ref: '#/components/schemas/VaultInfo' type: array total_items: description: The number of vaults. example: 1 type: integer required: - items - total_items type: object SpanStatus: description: SpanStatus is whether the work of a span failed. enum: - ok - error type: string TraceNode: properties: children: description: The spans under this one, in start order. items: $ref: '#/components/schemas/TraceNode' type: array clock_skew: description: 'How far the span and the spans under it were moved forward, as a Go duration, because the span started before its parent: the clock of its host is behind. Empty when the span was not moved.' type: string detail: description: What the span acted on, as key=value pairs, led by error= on a failed span. type: string duration: description: How long the span took, as a Go duration. type: string name: description: The name of the span, such as job.process. type: string "on": description: 'What ran the span: the role of its service, such as controller, agent or cli.' type: string span: $ref: '#/components/schemas/TraceSpan' status: description: The job's status on a job.process, changed or unchanged on a behavior write, and ok or error on other spans. type: string required: - name - "on" - duration - status - span type: object TraceResponse: properties: duration: description: From the start of the first span to the end of the last, as a Go duration. type: string failed_spans: description: The number of spans that failed. type: integer nats_calls: description: The number of NATS calls left out, the bookkeeping of the job queue. all shows them. type: integer nats_time: description: The time that the NATS calls left out took, as a Go duration. type: string services: description: The services that made the spans, in the order each first appears. items: type: string type: array spans: description: The spans that have no parent in the trace, each with its children, in start order. items: $ref: '#/components/schemas/TraceNode' type: array started: description: When the first span started. format: date-time type: string trace_id: description: The trace ID. type: string required: - trace_id - spans type: object TraceSpan: properties: attributes: additionalProperties: type: string description: The attributes of the span, each as text. type: object duration_ms: description: How long the span took, in milliseconds. format: double type: number kind: description: The span kind, such as server, client, producer or consumer. type: string name: description: The name of the span, such as job.process. type: string parent_span_id: description: The ID of the parent span. Empty for the root. type: string service: description: The service that made the span, such as osapi-agent. type: string span_id: description: The span ID. type: string start_time: description: When the span started. format: date-time type: string status: $ref: '#/components/schemas/SpanStatus' status_message: description: The error of a failed span. type: string required: - span_id - name - service - start_time - duration_ms - status - attributes type: object CertificateCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/CertificateEntry' type: array required: - results type: object CertificateCreateRequest: properties: name: description: The name of the CA, such as internal-ca, which osapi writes as osapi-internal-ca.crt pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,resource_name object: description: The object of the Object Store that has the PEM of the CA, as osapi client file upload stored it minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1 required: - name - object type: object CertificateCreateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/CertificateResult' type: array required: - results type: object CertificateDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/CertificateResult' type: array required: - results type: object CertificateEntry: properties: enabled: description: 'Whether the host trusts it: false for a system CA that the trust store turns off' type: boolean error: description: Error message if the agent failed. type: string fingerprint: description: The SHA-256 of the certificate, in hex type: string hostname: description: Hostname of the agent that produced this result. type: string managed: description: Whether osapi deployed it, and its writes change it type: boolean name: description: 'The CA: the name it was deployed with for a CA that osapi deployed, else its file''s name' type: string not_after: description: When it expires type: string object: description: The object that osapi deployed it from type: string path: description: The file, or on macOS the keychain, that has it type: string source: description: system for a CA of the distribution, local for one an administrator added type: string status: $ref: '#/components/schemas/RowStatus' subject: description: Its subject, such as CN=ISRG Root X1,O=Internet Security Research Group,C=US type: string required: - hostname - status type: object CertificateGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/CertificateEntry' type: array required: - results type: object CertificateResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string name: description: The CA type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object CertificateUpdateRequest: properties: object: description: The object that has the PEM; the one it was deployed from when empty minLength: 1 type: string x-oapi-codegen-extra-tags: validate: omitempty,min=1 type: object CertificateUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/CertificateResult' type: array required: - results type: object RowStatus: description: 'What happened on the host: ok, the operation ran and succeeded; failed, it ran and did not succeed; skipped, the host''s OS family does not support it; timeout, the host did not answer, so nobody knows whether it ran.' enum: - ok - failed - skipped - timeout type: string CommandExecRequest: properties: args: description: Its arguments, each one word, such as -la /tmp items: type: string type: array x-oapi-codegen-extra-tags: validate: omitempty command: description: The program, a name on the agent's PATH or a path, such as ls minLength: 1 pattern: ^[^-] type: string x-oapi-codegen-extra-tags: validate: required,min=1,startsnotwith=- cwd: description: The directory to run it in; the agent's own when empty type: string x-oapi-codegen-extra-tags: validate: omitempty timeout: description: Seconds to let it run before it is stopped, up to 300; 30 when 0 maximum: 300 minimum: 1 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=1,max=300 required: - command type: object CommandExecResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/CommandResult' type: array required: - results type: object CommandResult: properties: changed: description: 'Whether the host changed: true, since a command can change anything' type: boolean duration_ms: description: How long it ran, in milliseconds format: int64 type: integer error: description: Error message if the agent failed. type: string exit_code: description: Its exit code type: integer hostname: description: Hostname of the agent that produced this result. type: string status: $ref: '#/components/schemas/RowStatus' stderr: description: What it wrote to standard error type: string stdout: description: What it wrote to standard output type: string required: - hostname - status type: object CommandShellRequest: properties: command: description: The command line, which /bin/sh -c reads, such as ls -la /tmp | grep log minLength: 1 pattern: ^[^-] type: string x-oapi-codegen-extra-tags: validate: required,min=1,startsnotwith=- cwd: description: The directory to run it in; the agent's own when empty type: string x-oapi-codegen-extra-tags: validate: omitempty timeout: description: Seconds to let it run before it is stopped, up to 300; 30 when 0 maximum: 300 minimum: 1 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=1,max=300 required: - command type: object CommandShellResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/CommandResult' type: array required: - results type: object ConnectivityPingRequest: properties: address: description: The IPv4 or IPv6 address to ping, or an @fact. reference that the agent resolves type: string x-oapi-codegen-extra-tags: validate: required,ip_or_fact required: - address type: object ConnectivityPingResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ConnectivityPingResult' type: array required: - results type: object ConnectivityPingResult: properties: avg_rtt: description: Average round-trip time in milliseconds, with two decimals. Absent when no reply came back. type: string changed: description: 'Always false: a ping changes nothing on the host' type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string max_rtt: description: Maximum round-trip time in milliseconds, with two decimals. Absent when no reply came back. type: string min_rtt: description: Minimum round-trip time in milliseconds, with two decimals. Absent when no reply came back. type: string packet_loss: description: Percentage of packet loss format: double type: number packets_received: description: Number of packets received type: integer packets_sent: description: Number of packets sent type: integer status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object Disk: properties: free: description: The bytes free to use type: integer name: description: Where the filesystem is mounted type: string total: description: The size of the filesystem in bytes type: integer used: description: The bytes in use type: integer required: - name - total - used - free type: object DiskEntry: properties: disks: description: Each local filesystem items: $ref: '#/components/schemas/Disk' type: array error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object DiskGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/DiskEntry' type: array required: - results type: object DnsDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/DnsResult' type: array required: - results type: object DnsEntry: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string search_domains: description: The search domains items: type: string type: array servers: description: The DNS servers items: type: string type: array status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object DnsGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/DnsEntry' type: array required: - results type: object DnsResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string interface_name: description: The interface type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object DnsUpdateRequest: properties: override_dhcp: description: 'Use only these servers: drop the ones DHCP gives' type: boolean x-oapi-codegen-extra-tags: validate: omitempty search_domains: description: The search domains; the interface's own when empty items: format: hostname type: string maxItems: 16 type: array x-oapi-codegen-extra-tags: validate: omitempty,max=16,dive,hostname servers: description: The DNS servers, IPv4 or IPv6; the interface's own when empty items: format: ip type: string maxItems: 16 type: array x-oapi-codegen-extra-tags: validate: omitempty,max=16,dive,ip type: object DnsUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/DnsResult' type: array required: - results type: object ContainerState: description: ContainerState is the containers that a list shows, by their state. enum: - running - stopped - all type: string DockerCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/DockerEntry' type: array required: - results type: object DockerCreateRequest: properties: auto_start: description: Start the container once it is created type: boolean x-oapi-codegen-extra-tags: validate: omitempty command: description: The command, in place of the image's own items: type: string type: array x-oapi-codegen-extra-tags: validate: omitempty container_hostname: description: The hostname inside the container maxLength: 253 pattern: ^[a-zA-Z0-9][a-zA-Z0-9.-]*$ type: string x-oapi-codegen-extra-tags: validate: omitempty,dns_name,max=253 dns: description: The DNS servers of the container items: format: ip type: string type: array x-oapi-codegen-extra-tags: validate: omitempty,dive,ip env: additionalProperties: format: password type: string writeOnly: true x-osapi-secret: true description: 'The environment variables of the container. A secret: a reference, secret:///, or the value.' type: object writeOnly: true x-oapi-codegen-extra-tags: validate: omitempty x-osapi-secret: true image: description: The image to run, such as alpine:3.20; docker pulls it when the host does not have it pattern: ^[a-zA-Z0-9][a-zA-Z0-9._/:@-]*$ type: string x-oapi-codegen-extra-tags: validate: required,image_ref name: description: The container's name pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$ type: string x-oapi-codegen-extra-tags: validate: required,container_id ports: description: The published ports, each host:container, such as 8080:80 items: pattern: ^[0-9]{1,5}:[0-9]{1,5}$ type: string type: array x-oapi-codegen-extra-tags: validate: omitempty,dive,port_mapping volumes: description: The bind mounts, each host:container, such as /srv/data:/data items: pattern: ^/[^:]*:/[^:]*$ type: string type: array x-oapi-codegen-extra-tags: validate: omitempty,dive,volume_mapping required: - name - image type: object DockerCreateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/DockerResult' type: array required: - results type: object DockerDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/DockerResult' type: array required: - results type: object DockerEntry: properties: created: description: When it was created, RFC 3339 type: string env_names: description: The names of its environment variables; osapi never reads their values items: type: string type: array error: description: Error message if the agent failed. type: string health: description: 'The state of its health check: healthy, unhealthy or starting; empty without one' type: string hostname: description: Hostname of the agent that produced this result. type: string id: description: The container's full ID type: string image: description: The image it runs type: string mounts: description: The mounts, source:destination, with :ro when read only items: type: string type: array name: description: The container's name type: string networks: description: The networks, with the container's address and gateway on each items: type: string type: array ports: description: The published ports, host:port->container port items: type: string type: array state: description: running, exited, created, paused or restarting type: string status: $ref: '#/components/schemas/RowStatus' summary: description: What docker says of its state, such as Up 2 minutes type: string required: - hostname - status type: object DockerExecRequest: properties: command: description: The command and its arguments items: type: string minItems: 1 type: array x-oapi-codegen-extra-tags: validate: required,min=1 env: additionalProperties: format: password type: string writeOnly: true x-osapi-secret: true description: 'Environment variables for the command. A secret: a reference, secret:///, or the value.' type: object writeOnly: true x-oapi-codegen-extra-tags: validate: omitempty x-osapi-secret: true working_dir: description: The directory the command runs in pattern: ^/ type: string x-oapi-codegen-extra-tags: validate: omitempty,startswith=/ required: - command type: object DockerExecResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/DockerExecResult' type: array required: - results type: object DockerExecResult: properties: changed: description: 'Always true: osapi cannot tell what the command changed' type: boolean error: description: Error message if the agent failed. type: string exit_code: description: The command's exit code type: integer hostname: description: Hostname of the agent that produced this result. type: string status: $ref: '#/components/schemas/RowStatus' stderr: description: What the command wrote to standard error type: string stdout: description: What the command wrote to standard output type: string required: - hostname - status type: object DockerGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/DockerEntry' type: array required: - results type: object DockerResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string id: description: The container's full ID, for create type: string name: description: The container type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object DockerStartResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/DockerResult' type: array required: - results type: object DockerStopRequest: properties: timeout: description: Seconds to wait before docker kills it; docker's default when 0 maximum: 300 minimum: 0 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=0,max=300 type: object DockerStopResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/DockerResult' type: array required: - results type: object FileDeleteRequest: properties: path: description: Absolute path of the file on the host pattern: ^/ type: string x-oapi-codegen-extra-tags: validate: required,startswith=/ required: - path type: object FileDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/FileDeleteResult' type: array required: - results type: object FileDeleteResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string path: description: Absolute path of the file type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object FileGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/FileStatus' type: array required: - results type: object FileStatus: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string path: description: Absolute path of the file type: string sha256: description: SHA-256 of the file on the host, when it is there type: string state: description: in-sync, drifted, missing or unmanaged type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object FileUpdateRequest: properties: content_type: $ref: '#/components/schemas/ContentType' group: description: Group that owns the file; left as written when empty pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string x-oapi-codegen-extra-tags: validate: omitempty,account_name mode: description: Permissions in octal, such as 0644; when empty, a file keeps its mode and a new file gets 0644 pattern: ^[0-7]{3,4}$ type: string x-oapi-codegen-extra-tags: validate: omitempty,file_mode object_name: description: The object of the object store, from osapi client file list maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 owner: description: User that owns the file; left as written when empty pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string x-oapi-codegen-extra-tags: validate: omitempty,account_name path: description: Absolute path of the file on the host pattern: ^/ type: string x-oapi-codegen-extra-tags: validate: required,startswith=/ vars: additionalProperties: type: string description: Variables of a template, as .Vars, each as key=value type: object x-oapi-codegen-extra-tags: validate: omitempty required: - object_name - path type: object FileUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/FileUpdateResult' type: array required: - results type: object FileUpdateResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string path: description: Absolute path of the file type: string sha256: description: SHA-256 of the content that the file holds type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object GroupAccount: properties: error: description: Error message if the agent failed. type: string gid: description: Its numeric group ID type: integer hostname: description: Hostname of the agent that produced this result. type: string members: description: The users it has as members, besides those whose primary group it is items: type: string type: array name: description: The group type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object GroupCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/GroupAccount' type: array required: - results type: object GroupCreateRequest: properties: gid: description: Its numeric group ID; the system assigns one when it is 0 minimum: 0 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=0 name: description: The group to add, such as developers maxLength: 32 pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string x-oapi-codegen-extra-tags: validate: required,max=32,account_name system: description: Add it as a system group, with an ID from the system range type: boolean x-oapi-codegen-extra-tags: validate: omitempty required: - name type: object GroupCreateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/GroupResult' type: array required: - results type: object GroupDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/GroupResult' type: array required: - results type: object GroupGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/GroupAccount' type: array required: - results type: object GroupResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string name: description: The group type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object GroupUpdateRequest: properties: members: description: Its members, which replace the members it has; none when empty items: maxLength: 32 pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string type: array x-oapi-codegen-extra-tags: validate: omitempty,dive,max=32,account_name type: object GroupUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/GroupResult' type: array required: - results type: object HostnameEntry: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string name: description: The hostname of the host type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object HostnameGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/HostnameEntry' type: array required: - results type: object HostnameResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string name: description: The hostname of the host type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object HostnameUpdateRequest: properties: name: description: The hostname to set, such as web-01 format: hostname maxLength: 253 type: string x-oapi-codegen-extra-tags: validate: required,max=253,hostname required: - name type: object HostnameUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/HostnameResult' type: array required: - results type: object ImageCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ImageEntry' type: array required: - results type: object ImageDeleteRequest: properties: force: description: Remove it also when a container uses it type: boolean x-oapi-codegen-extra-tags: validate: omitempty type: object ImageDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ImageResult' type: array required: - results type: object ImageEntry: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string id: description: The image's ID type: string repository: description: Its repository, such as alpine type: string size: description: Its size, as docker prints it, such as 7.8MB type: string status: $ref: '#/components/schemas/RowStatus' tag: description: Its tag, such as 3.20 type: string required: - hostname - status type: object ImagePullRequest: properties: image: description: The image, such as alpine:3.20 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._/:@-]*$ type: string x-oapi-codegen-extra-tags: validate: required,image_ref required: - image type: object ImagePullResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ImagePullResult' type: array required: - results type: object ImagePullResult: properties: changed: description: 'Whether the pull got a new image: false when the host had it already' type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string image: description: The image type: string image_id: description: The ID of the image that the host has now type: string size: description: Its size in bytes format: int64 type: integer status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object ImageResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string image: description: The image type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object InterfaceCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/InterfaceEntry' type: array required: - results type: object InterfaceCreateRequest: properties: addresses: description: The static addresses, in CIDR notation, such as 10.0.0.5/24 items: format: cidr type: string maxItems: 16 type: array x-oapi-codegen-extra-tags: validate: omitempty,max=16,dive,cidr dhcp4: description: Take an IPv4 address from DHCP type: boolean x-oapi-codegen-extra-tags: validate: omitempty dhcp6: description: Take an IPv6 address from DHCP type: boolean x-oapi-codegen-extra-tags: validate: omitempty gateway4: description: The IPv4 default gateway format: ipv4 type: string x-oapi-codegen-extra-tags: validate: omitempty,ipv4 gateway6: description: The IPv6 default gateway format: ipv6 type: string x-oapi-codegen-extra-tags: validate: omitempty,ipv6 mac_address: description: The MAC address to set pattern: ^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$ type: string x-oapi-codegen-extra-tags: validate: omitempty,mac_address mtu: description: The MTU, from 68 to 9000 maximum: 9000 minimum: 68 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=68,max=9000 type: $ref: '#/components/schemas/InterfaceType' wakeonlan: description: Turn on wake-on-LAN type: boolean x-oapi-codegen-extra-tags: validate: omitempty type: object InterfaceCreateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/InterfaceResult' type: array required: - results type: object InterfaceDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/InterfaceResult' type: array required: - results type: object InterfaceEntry: properties: addresses: description: Each of its addresses, in CIDR notation items: type: string type: array dhcp4: description: 'Whether DHCP gave it an IPv4 address: a route of it has proto dhcp' type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string ipv4: description: Its first IPv4 address that is not link-local type: string ipv6: description: Its first IPv6 address that is not link-local type: string mac: description: Its MAC address; empty for one without, such as lo type: string mtu: description: Its MTU type: integer name: description: The interface type: string primary: description: Whether it has the default route type: boolean state: description: up or down type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object InterfaceGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/InterfaceEntry' type: array required: - results type: object InterfaceResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string name: description: The interface type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object InterfaceType: description: InterfaceType is the type of a network interface that osapi manages. enum: - ethernet - dummy type: string InterfaceUpdateRequest: properties: addresses: description: The static addresses, in CIDR notation, such as 10.0.0.5/24 items: format: cidr type: string maxItems: 16 type: array x-oapi-codegen-extra-tags: validate: omitempty,max=16,dive,cidr dhcp4: description: Take an IPv4 address from DHCP type: boolean x-oapi-codegen-extra-tags: validate: omitempty dhcp6: description: Take an IPv6 address from DHCP type: boolean x-oapi-codegen-extra-tags: validate: omitempty gateway4: description: The IPv4 default gateway format: ipv4 type: string x-oapi-codegen-extra-tags: validate: omitempty,ipv4 gateway6: description: The IPv6 default gateway format: ipv6 type: string x-oapi-codegen-extra-tags: validate: omitempty,ipv6 mac_address: description: The MAC address to set pattern: ^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$ type: string x-oapi-codegen-extra-tags: validate: omitempty,mac_address mtu: description: The MTU, from 68 to 9000 maximum: 9000 minimum: 68 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=68,max=9000 type: $ref: '#/components/schemas/InterfaceType' wakeonlan: description: Turn on wake-on-LAN type: boolean x-oapi-codegen-extra-tags: validate: omitempty type: object InterfaceUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/InterfaceResult' type: array required: - results type: object InterfaceRouteCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/InterfaceRouteEntry' type: array required: - results type: object InterfaceRouteCreateRequest: properties: destination: description: Where the route goes, in CIDR notation, such as 10.0.0.0/8; not a default route format: cidr type: string x-oapi-codegen-extra-tags: validate: required,cidr metric: description: The metric, from 0 to 4294967295; none when it is 0 maximum: 4294967295 minimum: 0 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=0,max=4294967295 via: description: The gateway, an address of the destination's family, such as 192.168.1.1 format: ip type: string x-oapi-codegen-extra-tags: validate: required,ip required: - destination - via type: object InterfaceRouteCreateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/InterfaceRouteResult' type: array required: - results type: object InterfaceRouteDeleteRequest: properties: destination: description: The destination of the route, in CIDR notation, such as 10.0.0.0/8 format: cidr type: string x-oapi-codegen-extra-tags: validate: required,cidr required: - destination type: object InterfaceRouteDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/InterfaceRouteResult' type: array required: - results type: object InterfaceRouteEntry: properties: destination: description: The destination in CIDR notation, or default type: string error: description: Error message if the agent failed. type: string family: description: inet or inet6 type: string gateway: description: The gateway; empty for a route on the link type: string hostname: description: Hostname of the agent that produced this result. type: string interface: description: The interface the route goes out of type: string metric: description: The metric; 0 when the kernel gives none type: integer proto: description: Where the route came from, such as kernel, dhcp or static; empty on macOS type: string scope: description: The scope, such as link; empty for a global route type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object InterfaceRouteResult: properties: changed: description: Whether the host changed type: boolean destination: description: The destination of the route type: string error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object InterfaceRouteUpdateRequest: properties: destination: description: Where the route goes, in CIDR notation, such as 10.0.0.0/8; not a default route format: cidr type: string x-oapi-codegen-extra-tags: validate: required,cidr metric: description: The metric, from 0 to 4294967295; none when it is 0 maximum: 4294967295 minimum: 0 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=0,max=4294967295 via: description: The gateway, an address of the destination's family, such as 192.168.1.1 format: ip type: string x-oapi-codegen-extra-tags: validate: required,ip required: - destination - via type: object InterfaceRouteUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/InterfaceRouteResult' type: array required: - results type: object Averages: properties: 1min: description: The load average over 1 minute format: double type: number 5min: description: The load average over 5 minutes format: double type: number 15min: description: The load average over 15 minutes format: double type: number required: - 1min - 5min - 15min type: object LoadEntry: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string load_average: $ref: '#/components/schemas/Averages' status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object LoadGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/LoadEntry' type: array required: - results type: object LogCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/LogEntry' type: array required: - results type: object LogEntry: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string message: description: The message type: string pid: description: The process that wrote it type: integer priority: $ref: '#/components/schemas/Priority' status: $ref: '#/components/schemas/RowStatus' timestamp: description: When journald recorded it, in RFC 3339 type: string unit: description: The syslog identifier that wrote it type: string required: - hostname - status type: object Priority: enum: - emerg - alert - crit - err - warning - notice - info - debug type: string LogSourceCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/LogSourceSource' type: array required: - results type: object LogSourceSource: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string name: description: The syslog identifier, such as sshd type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object MemoryEntry: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string memory: $ref: '#/components/schemas/Usage' status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object MemoryGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/MemoryEntry' type: array required: - results type: object Usage: properties: free: description: Free memory in bytes type: integer total: description: Total memory in bytes type: integer used: description: 'Used memory in bytes: the total less what is available' type: integer required: - total - free - used type: object NtpCreateRequest: properties: servers: description: The NTP servers, hostnames or IP addresses items: pattern: ^[A-Za-z0-9][A-Za-z0-9.:-]{0,252}$ type: string maxItems: 16 minItems: 1 type: array x-oapi-codegen-extra-tags: validate: required,min=1,max=16,dive,ntp_server required: - servers type: object NtpCreateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/NtpResult' type: array required: - results type: object NtpDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/NtpResult' type: array required: - results type: object NtpGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/NtpStatus' type: array required: - results type: object NtpResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object NtpStatus: properties: current_source: description: The source that chrony follows now type: string error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string offset: description: The offset of the system clock from NTP time, such as +0.000003422s type: string servers: description: The sources that chrony has items: type: string type: array status: $ref: '#/components/schemas/RowStatus' stratum: description: The NTP stratum of the host type: integer synchronized: description: Whether chrony is synchronized to a source type: boolean required: - hostname - status type: object NtpUpdateRequest: properties: servers: description: The NTP servers, hostnames or IP addresses items: pattern: ^[A-Za-z0-9][A-Za-z0-9.:-]{0,252}$ type: string maxItems: 16 minItems: 1 type: array x-oapi-codegen-extra-tags: validate: required,min=1,max=16,dive,ntp_server required: - servers type: object NtpUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/NtpResult' type: array required: - results type: object OsEntry: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string os_info: $ref: '#/components/schemas/Release' status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object OsGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/OsEntry' type: array required: - results type: object Release: properties: distribution: description: The distribution, such as ubuntu, or darwin type: string version: description: The version of the distribution, such as 24.04 type: string required: - distribution - version type: object PackageCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/PackageInstalled' type: array required: - results type: object PackageCreateRequest: properties: name: description: The package to install, such as curl maxLength: 255 pattern: ^[a-zA-Z0-9][a-zA-Z0-9.+_:~=-]*$ type: string x-oapi-codegen-extra-tags: validate: required,max=255,package_name version: description: The version to install, such as 8.5.0-2ubuntu10; the newest when empty maxLength: 255 pattern: ^[0-9][A-Za-z0-9.+~:-]*$ type: string x-oapi-codegen-extra-tags: validate: omitempty,max=255,package_version required: - name type: object PackageCreateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/PackageResult' type: array required: - results type: object PackageDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/PackageResult' type: array required: - results type: object PackageGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/PackageInstalled' type: array required: - results type: object PackageInstalled: properties: architecture: description: The architecture it is built for, such as amd64 type: string description: description: Its one-line summary type: string error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string manager: description: 'The package database that has it: dpkg, rpm or brew' type: string name: description: The package type: string size: description: Its installed size in bytes format: int64 type: integer status: $ref: '#/components/schemas/RowStatus' version: description: The installed version type: string required: - hostname - status type: object PackageResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string name: description: The package type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object PackageUpdatesAvailable: properties: current_version: description: The installed version type: string error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string name: description: The package type: string new_version: description: The version the index has type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object PackageUpdatesCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/PackageUpdatesAvailable' type: array required: - results type: object PackageUpdatesResult: properties: changed: description: Whether the refresh got new index data type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object PackageUpdatesUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/PackageUpdatesResult' type: array required: - results type: object PowerRebootRequest: properties: delay: description: Seconds before the host goes down. It rounds to whole minutes, at least one. minimum: 0 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=0 message: description: A message to the logged-in users first. type: string x-oapi-codegen-extra-tags: validate: omitempty type: object PowerRebootResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/PowerResult' type: array required: - results type: object PowerResult: properties: action: description: reboot or shutdown type: string changed: description: 'Always true: each run changes the host.' type: boolean delay: description: Seconds before the host goes down. type: integer error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object PowerShutdownRequest: properties: delay: description: Seconds before the host goes down. It rounds to whole minutes, at least one. minimum: 0 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=0 message: description: A message to the logged-in users first. type: string x-oapi-codegen-extra-tags: validate: omitempty type: object PowerShutdownResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/PowerResult' type: array required: - results type: object ProcessCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ProcessEntry' type: array required: - results type: object ProcessEntry: properties: command: description: Its full command line type: string cpu_percent: description: Its CPU time as a percent of the time since it started format: double type: number error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string mem_percent: description: Its resident memory as a percent of the host's memory type: number mem_rss: description: Its resident memory in bytes format: int64 type: integer name: description: The name of the process type: string pid: description: The process ID type: integer start_time: description: When it started, in RFC 3339 type: string state: description: Its state, such as running or sleep type: string status: $ref: '#/components/schemas/RowStatus' user: description: The user that runs it type: string required: - hostname - status type: object ProcessGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ProcessEntry' type: array required: - results type: object ProcessResult: properties: changed: description: Whether the signal was sent type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string pid: description: The process ID type: integer signal: $ref: '#/components/schemas/Signal' status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object ProcessSignalRequest: properties: signal: $ref: '#/components/schemas/Signal' required: - signal type: object ProcessSignalResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ProcessResult' type: array required: - results type: object Signal: description: Signal is a signal that osapi sends to a process, by its name without SIG. enum: - TERM - KILL - HUP - INT - USR1 - USR2 type: string Interval: description: Interval is how often a scheduled job runs, in place of a cron schedule. enum: - hourly - daily - weekly - monthly type: string ScheduleCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ScheduleEntry' type: array required: - results type: object ScheduleCreateRequest: properties: content_type: $ref: '#/components/schemas/ContentType' interval: $ref: '#/components/schemas/Interval' name: description: The entry, and its file name, such as backup maxLength: 64 pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,max=64,resource_name object: description: The object that holds the entry, from osapi client file upload maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 schedule: description: A cron expression, such as */5 * * * *; give it or interval type: string x-oapi-codegen-extra-tags: validate: required_without=Interval,excluded_with=Interval,omitempty,cron_schedule user: description: The user the entry runs as pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string x-oapi-codegen-extra-tags: validate: omitempty,account_name vars: additionalProperties: type: string description: The vars of a template, as key=value type: object x-oapi-codegen-extra-tags: validate: omitempty required: - name - object type: object ScheduleCreateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ScheduleResult' type: array required: - results type: object ScheduleDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ScheduleResult' type: array required: - results type: object ScheduleEntry: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string interval: description: Its interval, for a script in /etc/cron.daily and the like type: string name: description: The entry type: string object: description: The object it was deployed from type: string schedule: description: Its cron expression, for an entry in /etc/cron.d type: string source: description: 'Where its file is: cron.d, or the interval' type: string status: $ref: '#/components/schemas/RowStatus' user: description: The user it runs as type: string required: - hostname - status type: object ScheduleGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ScheduleEntry' type: array required: - results type: object ScheduleResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string name: description: The entry type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object ScheduleUpdateRequest: properties: content_type: $ref: '#/components/schemas/ContentType' object: description: The object to deploy; the entry's own when empty maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: omitempty,min=1,max=255 schedule: description: A new cron expression; the entry's own when empty type: string x-oapi-codegen-extra-tags: validate: omitempty,cron_schedule user: description: The user the entry runs as; the entry's own when empty pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string x-oapi-codegen-extra-tags: validate: omitempty,account_name vars: additionalProperties: type: string description: The vars of a template, as key=value type: object x-oapi-codegen-extra-tags: validate: omitempty type: object ScheduleUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ScheduleResult' type: array required: - results type: object ServiceCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ServiceEntry' type: array required: - results type: object ServiceCreateRequest: properties: name: description: The service, such as app for osapi-app.service pattern: ^[a-zA-Z0-9_@.-]+$ type: string x-oapi-codegen-extra-tags: validate: required,service_name object: description: The object that holds the unit file, from osapi client file upload maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 required: - name - object type: object ServiceCreateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ServiceResult' type: array required: - results type: object ServiceDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ServiceResult' type: array required: - results type: object ServiceDisableResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ServiceResult' type: array required: - results type: object ServiceEnableResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ServiceResult' type: array required: - results type: object ServiceEntry: properties: description: description: The Description= of its unit type: string enabled: description: 'Whether it starts at boot: the state of its unit file' type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string managed: description: Whether osapi deployed it, so its writes and actions act on it type: boolean name: description: The service, without .service type: string state: description: What systemd says it does now, such as running, exited or dead type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object ServiceGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ServiceEntry' type: array required: - results type: object ServiceRestartResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ServiceResult' type: array required: - results type: object ServiceResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string name: description: The service type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object ServiceStartResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ServiceResult' type: array required: - results type: object ServiceStopResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ServiceResult' type: array required: - results type: object ServiceUpdateRequest: properties: object: description: The object that holds the unit file, from osapi client file upload maxLength: 255 minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,max=255 required: - object type: object ServiceUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/ServiceResult' type: array required: - results type: object Entry: properties: seconds: description: How long the host has run, in seconds type: integer uptime: description: How long the host has run, in days, hours and minutes type: string required: - uptime - seconds type: object StatusEntry: properties: disks: description: Each local filesystem items: $ref: '#/components/schemas/Disk' type: array error: description: Error message if the agent failed. type: string errors: description: 'Each read that failed, as name: error. The other fields still answer.' items: type: string type: array hostname: description: Hostname of the agent that produced this result. type: string load_average: $ref: '#/components/schemas/Averages' memory: $ref: '#/components/schemas/Usage' name: description: The hostname of the host, as the hostname command prints it type: string os_info: $ref: '#/components/schemas/Release' status: $ref: '#/components/schemas/RowStatus' uptime: $ref: '#/components/schemas/Entry' required: - hostname - status type: object StatusGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/StatusEntry' type: array required: - results type: object SysctlCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/SysctlEntry' type: array required: - results type: object SysctlCreateRequest: properties: key: description: Parameter name, such as net.ipv4.ip_forward minLength: 1 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]*$ type: string x-oapi-codegen-extra-tags: validate: required,min=1,sysctl_key value: description: Value to set pattern: ^[^\r\n]*$ type: string x-oapi-codegen-extra-tags: validate: required,no_linebreak required: - key - value type: object SysctlCreateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/SysctlMutationResult' type: array required: - results type: object SysctlDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/SysctlMutationResult' type: array required: - results type: object SysctlEntry: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string key: description: Parameter name type: string managed: description: 'Whether osapi manages it: a file of its own sets it at boot' type: boolean status: $ref: '#/components/schemas/RowStatus' value: description: Current runtime value type: string required: - hostname - status type: object SysctlGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/SysctlEntry' type: array required: - results type: object SysctlMutationResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string key: description: Parameter name type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object SysctlUpdateRequest: properties: value: description: Value to set pattern: ^[^\r\n]*$ type: string x-oapi-codegen-extra-tags: validate: required,no_linebreak required: - value type: object SysctlUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/SysctlMutationResult' type: array required: - results type: object TimezoneEntry: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string status: $ref: '#/components/schemas/RowStatus' timezone: description: The IANA name of the timezone, such as America/New_York type: string utc_offset: description: The offset from UTC now, such as -05:00 type: string required: - hostname - status type: object TimezoneGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/TimezoneEntry' type: array required: - results type: object TimezoneResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string status: $ref: '#/components/schemas/RowStatus' timezone: description: The timezone of the host type: string required: - hostname - status type: object TimezoneUpdateRequest: properties: timezone: description: The IANA name of the timezone, such as UTC or America/New_York maxLength: 64 pattern: ^[A-Za-z0-9_+][A-Za-z0-9_+-]*(/[A-Za-z0-9_+-]+)*$ type: string x-oapi-codegen-extra-tags: validate: required,max=64,timezone_name required: - timezone type: object TimezoneUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/TimezoneResult' type: array required: - results type: object UptimeEntry: properties: error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string seconds: description: How long the host has run, in seconds type: integer status: $ref: '#/components/schemas/RowStatus' uptime: description: How long the host has run, in days, hours and minutes type: string required: - hostname - status type: object UptimeGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/UptimeEntry' type: array required: - results type: object Lock: description: Lock is whether a user account refuses logins with its password. enum: - locked - unlocked type: string UserAccount: properties: error: description: Error message if the agent failed. type: string gid: description: Its primary group ID type: integer groups: description: The groups it is a member of, besides its primary group items: type: string type: array home: description: Its home directory type: string hostname: description: Hostname of the agent that produced this result. type: string locked: description: Whether a login with its password is refused type: boolean name: description: The user type: string shell: description: Its login shell type: string status: $ref: '#/components/schemas/RowStatus' uid: description: Its numeric user ID type: integer required: - hostname - status type: object UserCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/UserAccount' type: array required: - results type: object UserCreateRequest: properties: gid: description: Its primary group ID; a group of its own when it is 0 minimum: 0 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=0 groups: description: The groups it is a member of, besides its primary group items: maxLength: 32 pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string type: array x-oapi-codegen-extra-tags: validate: omitempty,dive,max=32,account_name home: description: Its home directory; /home/ when empty pattern: ^[^\r\n]*$ type: string x-oapi-codegen-extra-tags: validate: omitempty,startswith=/,no_linebreak name: description: The user to add, such as alice maxLength: 32 pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string x-oapi-codegen-extra-tags: validate: required,max=32,account_name password: description: 'Its password, which osapi hashes on the controller; none when empty. A secret: a reference, secret:///, or the value.' format: password pattern: ^[^\r\n]*$ type: string writeOnly: true x-oapi-codegen-extra-tags: validate: omitempty,no_linebreak x-osapi-secret: true shell: description: Its login shell, such as /bin/bash; the system's default when empty pattern: ^[^\r\n]*$ type: string x-oapi-codegen-extra-tags: validate: omitempty,startswith=/,no_linebreak system: description: Add it as a system user, with an ID from the system range type: boolean x-oapi-codegen-extra-tags: validate: omitempty uid: description: Its numeric user ID; the system assigns one when it is 0 minimum: 0 type: integer x-oapi-codegen-extra-tags: validate: omitempty,min=0 required: - name type: object UserCreateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/UserResult' type: array required: - results type: object UserDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/UserResult' type: array required: - results type: object UserGetResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/UserAccount' type: array required: - results type: object UserResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string name: description: The user type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object UserUpdateRequest: properties: groups: description: The groups it is a member of, which replace the groups it has items: maxLength: 32 pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string type: array x-oapi-codegen-extra-tags: validate: omitempty,dive,max=32,account_name home: description: Its home directory, which usermod moves the files to pattern: ^[^\r\n]*$ type: string x-oapi-codegen-extra-tags: validate: omitempty,startswith=/,no_linebreak lock: $ref: '#/components/schemas/Lock' shell: description: Its login shell, such as /bin/bash pattern: ^[^\r\n]*$ type: string x-oapi-codegen-extra-tags: validate: omitempty,startswith=/,no_linebreak type: object UserUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/UserResult' type: array required: - results type: object UserPasswordResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string hostname: description: Hostname of the agent that produced this result. type: string name: description: The user type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object UserPasswordUpdateRequest: properties: password: description: 'The new password, which osapi hashes on the controller. A secret: a reference, secret:///, or the value.' format: password pattern: ^[^\r\n]*$ type: string writeOnly: true x-oapi-codegen-extra-tags: validate: omitempty,no_linebreak x-osapi-secret: true type: object UserPasswordUpdateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/UserPasswordResult' type: array required: - results type: object UserSshkeyCollectionResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/UserSshkeyKey' type: array required: - results type: object UserSshkeyCreateRequest: properties: key: description: The public key line, such as ssh-ed25519 AAAA... alice@laptop, with options before it if any pattern: ^[^\r\n]*$ type: string x-oapi-codegen-extra-tags: validate: required,no_linebreak required: - key type: object UserSshkeyCreateResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/UserSshkeyResult' type: array required: - results type: object UserSshkeyDeleteRequest: properties: fingerprint: description: The SHA256 fingerprint of the key, as list shows it pattern: ^[^\r\n]*$ type: string x-oapi-codegen-extra-tags: validate: required,startswith=SHA256:,no_linebreak required: - fingerprint type: object UserSshkeyDeleteResponse: properties: job_id: description: The job ID used to process this request. example: 550e8400-e29b-41d4-a716-446655440000 format: uuid type: string x-oapi-codegen-extra-tags: validate: uuid results: items: $ref: '#/components/schemas/UserSshkeyResult' type: array required: - results type: object UserSshkeyKey: properties: comment: description: The comment after the key, such as alice@laptop type: string error: description: Error message if the agent failed. type: string fingerprint: description: The SHA256 fingerprint of the key type: string hostname: description: Hostname of the agent that produced this result. type: string options: description: The options before the key, such as from="10.0.0.0/8" type: string status: $ref: '#/components/schemas/RowStatus' type: description: The key type, such as ssh-ed25519 type: string required: - hostname - status type: object UserSshkeyResult: properties: changed: description: Whether the host changed type: boolean error: description: Error message if the agent failed. type: string fingerprint: description: The SHA256 fingerprint of the key type: string hostname: description: Hostname of the agent that produced this result. type: string status: $ref: '#/components/schemas/RowStatus' required: - hostname - status type: object securitySchemes: BearerAuth: bearerFormat: JWT scheme: bearer type: http parameters: CertificateName: description: The CA that osapi deployed, such as internal-ca in: path name: name required: true schema: pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,resource_name Hostname: description: 'Target: _all, _any, hostname, or label (group:web.dev).' in: path name: hostname required: true schema: minLength: 1 type: string x-oapi-codegen-extra-tags: validate: required,min=1,valid_target DnsInterface_name: description: The interface, such as eth0, or a fact such as @fact.interface.primary in: path name: interface_name required: true schema: pattern: ^(@fact\.[a-z0-9_.]+|[a-zA-Z0-9][a-zA-Z0-9._-]{0,14})$ type: string x-oapi-codegen-extra-tags: validate: required,interface_name DockerName: description: The container's name or ID in: path name: name required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$ type: string x-oapi-codegen-extra-tags: validate: required,container_id GroupName: description: The group to remove, such as developers in: path name: name required: true schema: maxLength: 32 pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string x-oapi-codegen-extra-tags: validate: required,max=32,account_name ImageImage: description: The image, by its reference or its ID in: path name: image required: true schema: pattern: ^[a-zA-Z0-9][a-zA-Z0-9._/:@-]*$ type: string x-oapi-codegen-extra-tags: validate: required,image_ref InterfaceName: description: The interface, such as eth0, or a fact such as @fact.interface.primary in: path name: name required: true schema: pattern: ^(@fact\.[a-z0-9_.]+|[a-zA-Z0-9][a-zA-Z0-9._-]{0,14})$ type: string x-oapi-codegen-extra-tags: validate: required,interface_name InterfaceRouteName: description: The interface, such as eth0, or a fact such as @fact.interface.primary in: path name: name required: true schema: pattern: ^(@fact\.[a-z0-9_.]+|[a-zA-Z0-9][a-zA-Z0-9._-]{0,14})$ type: string x-oapi-codegen-extra-tags: validate: required,interface_name PackageName: description: The package to remove, such as curl in: path name: name required: true schema: maxLength: 255 pattern: ^[a-zA-Z0-9][a-zA-Z0-9.+_:~=-]*$ type: string x-oapi-codegen-extra-tags: validate: required,max=255,package_name ProcessPid: description: The process ID, such as 1234 in: path name: pid required: true schema: minimum: 1 type: integer x-oapi-codegen-extra-tags: validate: required,min=1 ScheduleName: description: The entry, such as backup in: path name: name required: true schema: maxLength: 64 pattern: ^[a-zA-Z0-9_-]+$ type: string x-oapi-codegen-extra-tags: validate: required,max=64,resource_name ServiceName: description: The service, such as app for osapi-app.service in: path name: name required: true schema: pattern: ^[a-zA-Z0-9_@.-]+$ type: string x-oapi-codegen-extra-tags: validate: required,service_name SysctlKey: description: Parameter name, such as net.ipv4.ip_forward in: path name: key required: true schema: minLength: 1 pattern: ^[a-zA-Z0-9][a-zA-Z0-9._-]*$ type: string x-oapi-codegen-extra-tags: validate: required,min=1,sysctl_key UserName: description: The user to remove, with its home directory, such as alice in: path name: name required: true schema: maxLength: 32 pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string x-oapi-codegen-extra-tags: validate: required,max=32,account_name UserPasswordName: description: The user, such as alice in: path name: name required: true schema: maxLength: 32 pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string x-oapi-codegen-extra-tags: validate: required,max=32,account_name UserSshkeyName: description: The user, such as alice in: path name: name required: true schema: maxLength: 32 pattern: ^[a-z_][a-z0-9_-]*\$?$ type: string x-oapi-codegen-extra-tags: validate: required,max=32,account_name x-tagGroups: - name: Services tags: - Service_API_service_operations - name: Software tags: - Package_API_package_operations - Updates_API_updates_operations - name: Config tags: - File_API_file_operations - Hostname_API_hostname_operations - Ntp_API_ntp_operations - Schedule_API_schedule_operations - Sysctl_API_sysctl_operations - Timezone_API_timezone_operations - name: Node tags: - Load_API_load_operations - Os_API_os_operations - Power_API_power_operations - Process_API_process_operations - Status_API_status_operations - Uptime_API_uptime_operations - name: Logs tags: - Log_API_log_operations - Source_API_source_operations - name: Networking tags: - Connectivity_API_connectivity_operations - Dns_API_dns_operations - Interface_API_interface_operations - Route_API_route_operations - name: Security tags: - Certificate_API_certificate_operations - Group_API_group_operations - User_API_user_operations - Password_API_password_operations - Sshkey_API_sshkey_operations - name: Containers tags: - Docker_API_docker_operations - Image_API_image_operations - name: Object Store tags: - File_Management_API_file_operations - name: Secrets tags: - Secret_Management_API_secret_operations - name: Command tags: - Command_API_command_operations - name: Hardware tags: - Disk_API_disk_operations - Memory_API_memory_operations - name: Audit tags: - Audit_Log_API_audit - name: Fleet tags: - Admission_API_admission - Agent_Management_API_agent_operations - Catalog_API_catalog - Health_Check_API_health - Job_Management_API_job_operations - Telemetry_API_telemetry x-osapi-areas: - name: services label: Services - name: software label: Software - name: config label: Config - name: node label: Node - name: logs label: Logs - name: networking label: Networking - name: security label: Security - name: containers label: Containers - name: objectstore label: Object Store - name: secrets label: Secrets - name: command label: Command - name: hardware label: Hardware - name: audit label: Audit - name: fleet label: Fleet