# Agents

## GET /agents

> List Agents

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/agents":{"get":{"tags":["agents"],"summary":"List Agents","parameters":[{"schema":{"type":"string"},"description":"the query to filter agents by, e.g. name:agent-1","name":"query","in":"query"},{"schema":{"type":"string"},"description":"the selector to filter agents by, e.g. configuration=my-config","name":"selector","in":"query"},{"schema":{"type":"string"},"description":"the pagination offset","name":"offset","in":"query"},{"schema":{"type":"string"},"description":"the maximum number of results to return","name":"limit","in":"query"},{"schema":{"type":"string"},"description":"the field on which to sort results. A '-' prefix indicates descending sorting.","name":"sort","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.AgentsResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}}}}},"components":{"schemas":{"model.AgentsResponse":{"type":"object","properties":{"agents":{"type":"array","items":{"$ref":"#/components/schemas/model.Agent"}}}},"model.Agent":{"type":"object","properties":{"arch":{"type":"string"},"available_components_hash":{"type":"string"},"configuration":{"description":"tracked by Bindplane"},"configurationStatus":{"$ref":"#/components/schemas/model.ConfigurationVersions"},"connectedAt":{"type":"string"},"disconnectedAt":{"type":"string"},"errorMessage":{"type":"string"},"features":{"$ref":"#/components/schemas/model.AgentFeatures"},"fleet":{"description":"Fleet is the name of the fleet that the agent is a member of. Because this can be\nspecified by the fleet: label on the agent, it is possible that the fleet with this\nname does not exist.","type":"string"},"fleetStatus":{"description":"FleetStatus is the status of the agent's fleet assignment.","allOf":[{"$ref":"#/components/schemas/model.AgentFleetStatus"}]},"hostname":{"type":"string"},"id":{"type":"string"},"labels":{"description":"Labels are the current labels for the agent.","allOf":[{"$ref":"#/components/schemas/model.Labels"}]},"labels_bootstrapped":{"description":"LabelsBootstrapped is true if the labels have been \"bootstrapped\" (meaning, the initial labels have been set).\nWhen this is true, labels in the agent description are not applied. This is set to true after the initial agent labels are set.","type":"boolean"},"macAddress":{"type":"string"},"name":{"type":"string"},"operatingSystem":{"type":"string"},"outOfDate":{"type":"boolean"},"pendingLabels":{"description":"PendingLabels are deprecated, and should not be used.\nInstead, merge extra labels into Labels to modify the agent labels.","allOf":[{"$ref":"#/components/schemas/model.Labels"}]},"platform":{"type":"string"},"protocol":{"type":"string"},"remoteAddress":{"type":"string"},"reported_at":{"description":"ReportedAt is only available in boltstore.","type":"string"},"state":{},"status":{"description":"reported by Status messages","allOf":[{"$ref":"#/components/schemas/model.AgentStatus"}]},"type":{"description":"Type should match the AgentType of this collector. This value is set from the \"service.name\" attribute in the\nOpAMP AgentDescription.","type":"string"},"upgrade":{"description":"Upgrade stores information about an agent upgrade","allOf":[{"$ref":"#/components/schemas/model.AgentUpgrade"}]},"version":{"type":"string"}}},"model.ConfigurationVersions":{"type":"object","properties":{"assigned":{"description":"Assigned is the configuration that has been assigned to the agent. It may not be\nrolled out to the agent. Use Current for the configuration actually in use by the\nAgent. This will be the name of the configuration and will not have a version\nassociated with it.","type":"string"},"current":{"description":"Current is the configuration currently applied to the agent.","type":"string"},"currentStage":{"description":"CurrentStage is the stage of the Current configuration","type":"integer","format":"int16"},"dirty":{"description":"Dirty is true if the assigned configuration has been modified but it has not been\napplied to the agent via Future/Pending/Current.","type":"boolean"},"future":{"description":"Future is the configuration that this agent is scheduled for when a rollout starts.\nAs the rollout progresses, this value becomes Pending and this will be cleared.","type":"string"},"futureStage":{"description":"FutureStage is the stage of the Future configuration","type":"integer","format":"int16"},"pending":{"description":"Pending is the configuration that OPAMP has been notified via the event bus to apply to this agent.\nOnce this configuration is confirmed, Current will be set to this value and this will be cleared.","type":"string"},"pendingSetAt":{"type":"string"},"pendingStage":{"description":"PendingStage is the stage of the Pending configuration","type":"integer","format":"int16"}}},"model.AgentFeatures":{"type":"integer","enum":[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,257]},"model.AgentFleetStatus":{"type":"integer","enum":[0,1,2]},"model.Labels":{"type":"object"},"model.AgentStatus":{"type":"integer","enum":[0,1,2,4,5,6,7,8,9]},"model.AgentUpgrade":{"type":"object","properties":{"allPackagesHash":{"description":"AllPackagesHash is the hash of the packages sent to the agent to upgrade","type":"array","items":{"type":"integer"}},"error":{"description":"Error is set if there were errors upgrading the agent","type":"string"},"status":{"description":"Status indicates the progress of the agent upgrade","allOf":[{"$ref":"#/components/schemas/model.AgentUpgradeStatus"}]},"version":{"description":"Version is used to indicate that an agent should be or is being upgraded. The agent status will be set to Upgrading\nwhen the upgrade begins.","type":"string"}}},"model.AgentUpgradeStatus":{"type":"integer","enum":[0,1,2]},"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}
```

## DELETE /agents

> Delete agents by ids

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/agents":{"delete":{"tags":["agents"],"summary":"Delete agents by ids","parameters":[{"schema":{"type":"integer"},"description":"the maximum number of agents to delete","name":"limit","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.DeleteAgentsResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.DeleteAgentsPayload"}}},"description":"list of agent ids to delete","required":true}}}},"components":{"schemas":{"model.DeleteAgentsResponse":{"type":"object","properties":{"agents":{"type":"array","items":{"type":"string"}}}},"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}},"model.DeleteAgentsPayload":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}}}}}}
```

## PATCH /agents/labels

> Bulk apply labels to agents

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/agents/labels":{"patch":{"tags":["agents"],"summary":"Bulk apply labels to agents","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.BulkAgentLabelsResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.BulkAgentLabelsPayload"}}},"description":"Request body containing agent IDs and labels","required":true}}}},"components":{"schemas":{"model.BulkAgentLabelsResponse":{"type":"object","properties":{"count":{"type":"integer"},"errors":{"type":"array","items":{"type":"string"}},"failedIds":{"description":"FailedIDs contains the IDs that failed to be updated when IncludeFailedIDs was requested","type":"array","items":{"type":"string"}}}},"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}},"model.BulkAgentLabelsPayload":{"description":"Body of the request to update labels for multiple agents","type":"object","properties":{"ids":{"description":"IDs is the list of agent IDs to update","type":"array","items":{"type":"string"}},"includeFailedIds":{"description":"IncludeFailedIDs when true, and when IDs are provided, will include the IDs that failed to update\nin the BulkAgentLabelsResponse under the \"failedIds\" field.","type":"boolean"},"labels":{"description":"Labels are name/value pairs of labels to update. Empty values indicate that the label should be deleted.","type":"object","additionalProperties":{"type":"string"}},"overwrite":{"description":"Overwrite is true if the labels should be overwritten. Must be true if modifying a pre-existing label value.","type":"boolean"},"query":{"description":"Query is a query string to find agents to update, e.g. \"env:production\". A query can\nmatch fields or labels on the agent.","type":"string"},"selector":{"description":"Selector is the selector to find agents to update, e.g. \"env=production\". A selector\nmatches labels on the agent and supports \"!\", \"=\", \"==\", \"in\", \"!=\", \"notin\", and\n\"exists\" operators.","type":"string"}}}}}}
```

## PATCH /agents/version

> Update multiple agents

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/agents/version":{"patch":{"tags":["agents"],"summary":"Update multiple agents","responses":{"204":{"description":"Upgrade request processed, no content"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.PatchAgentVersionsRequest"}}},"description":"request body containing ids and version","required":true}}}},"components":{"schemas":{"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}},"model.PatchAgentVersionsRequest":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}},"version":{"type":"string"}}}}}}
```

## GET /agents/{id}

> Get agent by id

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/agents/{id}":{"get":{"tags":["agents"],"summary":"Get agent by id","parameters":[{"schema":{"type":"string"},"description":"the id of the agent","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.AgentResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}}}}},"components":{"schemas":{"model.AgentResponse":{"type":"object","properties":{"agent":{"$ref":"#/components/schemas/model.Agent"}}},"model.Agent":{"type":"object","properties":{"arch":{"type":"string"},"available_components_hash":{"type":"string"},"configuration":{"description":"tracked by Bindplane"},"configurationStatus":{"$ref":"#/components/schemas/model.ConfigurationVersions"},"connectedAt":{"type":"string"},"disconnectedAt":{"type":"string"},"errorMessage":{"type":"string"},"features":{"$ref":"#/components/schemas/model.AgentFeatures"},"fleet":{"description":"Fleet is the name of the fleet that the agent is a member of. Because this can be\nspecified by the fleet: label on the agent, it is possible that the fleet with this\nname does not exist.","type":"string"},"fleetStatus":{"description":"FleetStatus is the status of the agent's fleet assignment.","allOf":[{"$ref":"#/components/schemas/model.AgentFleetStatus"}]},"hostname":{"type":"string"},"id":{"type":"string"},"labels":{"description":"Labels are the current labels for the agent.","allOf":[{"$ref":"#/components/schemas/model.Labels"}]},"labels_bootstrapped":{"description":"LabelsBootstrapped is true if the labels have been \"bootstrapped\" (meaning, the initial labels have been set).\nWhen this is true, labels in the agent description are not applied. This is set to true after the initial agent labels are set.","type":"boolean"},"macAddress":{"type":"string"},"name":{"type":"string"},"operatingSystem":{"type":"string"},"outOfDate":{"type":"boolean"},"pendingLabels":{"description":"PendingLabels are deprecated, and should not be used.\nInstead, merge extra labels into Labels to modify the agent labels.","allOf":[{"$ref":"#/components/schemas/model.Labels"}]},"platform":{"type":"string"},"protocol":{"type":"string"},"remoteAddress":{"type":"string"},"reported_at":{"description":"ReportedAt is only available in boltstore.","type":"string"},"state":{},"status":{"description":"reported by Status messages","allOf":[{"$ref":"#/components/schemas/model.AgentStatus"}]},"type":{"description":"Type should match the AgentType of this collector. This value is set from the \"service.name\" attribute in the\nOpAMP AgentDescription.","type":"string"},"upgrade":{"description":"Upgrade stores information about an agent upgrade","allOf":[{"$ref":"#/components/schemas/model.AgentUpgrade"}]},"version":{"type":"string"}}},"model.ConfigurationVersions":{"type":"object","properties":{"assigned":{"description":"Assigned is the configuration that has been assigned to the agent. It may not be\nrolled out to the agent. Use Current for the configuration actually in use by the\nAgent. This will be the name of the configuration and will not have a version\nassociated with it.","type":"string"},"current":{"description":"Current is the configuration currently applied to the agent.","type":"string"},"currentStage":{"description":"CurrentStage is the stage of the Current configuration","type":"integer","format":"int16"},"dirty":{"description":"Dirty is true if the assigned configuration has been modified but it has not been\napplied to the agent via Future/Pending/Current.","type":"boolean"},"future":{"description":"Future is the configuration that this agent is scheduled for when a rollout starts.\nAs the rollout progresses, this value becomes Pending and this will be cleared.","type":"string"},"futureStage":{"description":"FutureStage is the stage of the Future configuration","type":"integer","format":"int16"},"pending":{"description":"Pending is the configuration that OPAMP has been notified via the event bus to apply to this agent.\nOnce this configuration is confirmed, Current will be set to this value and this will be cleared.","type":"string"},"pendingSetAt":{"type":"string"},"pendingStage":{"description":"PendingStage is the stage of the Pending configuration","type":"integer","format":"int16"}}},"model.AgentFeatures":{"type":"integer","enum":[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,257]},"model.AgentFleetStatus":{"type":"integer","enum":[0,1,2]},"model.Labels":{"type":"object"},"model.AgentStatus":{"type":"integer","enum":[0,1,2,4,5,6,7,8,9]},"model.AgentUpgrade":{"type":"object","properties":{"allPackagesHash":{"description":"AllPackagesHash is the hash of the packages sent to the agent to upgrade","type":"array","items":{"type":"integer"}},"error":{"description":"Error is set if there were errors upgrading the agent","type":"string"},"status":{"description":"Status indicates the progress of the agent upgrade","allOf":[{"$ref":"#/components/schemas/model.AgentUpgradeStatus"}]},"version":{"description":"Version is used to indicate that an agent should be or is being upgraded. The agent status will be set to Upgrading\nwhen the upgrade begins.","type":"string"}}},"model.AgentUpgradeStatus":{"type":"integer","enum":[0,1,2]},"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}
```

## GET /agents/{id}/configuration

> Get configuration for a given agent

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/agents/{id}/configuration":{"get":{"tags":["agents"],"summary":"Get configuration for a given agent","parameters":[{"schema":{"type":"string"},"description":"the id of the agent","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ConfigurationResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}}}}},"components":{"schemas":{"model.ConfigurationResponse":{"type":"object","properties":{"configuration":{"$ref":"#/components/schemas/model.Configuration"},"raw":{"type":"string"}}},"model.Configuration":{"type":"object","properties":{"apiVersion":{"type":"string"},"kind":{"allOf":[{"$ref":"#/components/schemas/model.Kind"}]},"metadata":{"$ref":"#/components/schemas/model.Metadata"},"spec":{"description":"Spec contains the spec for the Configuration","allOf":[{"$ref":"#/components/schemas/model.ConfigurationSpec"}]},"status":{"$ref":"#/components/schemas/model.ConfigurationStatus"}}},"model.Kind":{"type":"string","enum":["Configuration","Agent","AgentType","AgentVersion","Source","Processor","Connector","Destination","Extension","SourceType","ProcessorType","ConnectorType","DestinationType","ExtensionType","RecommendationType","Unknown","Rollout","RolloutType","Organization","Account","Invitation","Login","User","AccountOrganizationBinding","UserOrganizationBinding","UserAccountBinding","AuditTrail","AvailableComponents","SecretsManagerType","SecretsManager","Recording","Credential","CredentialType","Fleet","Integration","IntegrationType","ConfigurationType","Notification","Recommendation","PublicProcessor","Blueprint","PrometheusRule","APIKey","ResourcePreset"]},"model.Metadata":{"type":"object","properties":{"additionalInfo":{"$ref":"#/components/schemas/model.AdditionalInfo"},"blueprintTags":{"description":"BlueprintTags holds categorized tags for blueprints (e.g., use-case, destination).\nUnlike Labels, this supports multiple values per category.","allOf":[{"$ref":"#/components/schemas/model.BlueprintTags"}]},"dateModified":{"type":"string"},"deprecated":{"description":"Deprecated indicates that this resource is deprecated and should not be used. Deprecated resources should contain\nadditional information about why the resource is deprecated and what should be used instead.\nNote: Ironically, the Deprecated field is itself deprecated. Use Stability instead.","type":"boolean"},"description":{"type":"string"},"displayName":{"type":"string"},"hash":{"description":"Hash is a hex formatted sha256 Hash of the json-encoded spec that is used to determine if the spec has changed.","type":"string"},"icon":{"type":"string"},"id":{"type":"string"},"labels":{"$ref":"#/components/schemas/model.Labels"},"name":{"type":"string"},"resourceDocLink":{"type":"string"},"stability":{"description":"Stability is the stability of the resource, one of development, alpha, beta, stable, or\ndeprecated. This should be used instead of the Deprecated field.","allOf":[{"$ref":"#/components/schemas/model.Stability"}]},"version":{"description":"Version is a 1-based integer that is incremented each time the spec is changed.","type":"integer"},"warning":{"description":"Warning is an optional message that is displayed to the user when the resource is configured. Currently used for IntegrationTypes.","type":"string"}}},"model.AdditionalInfo":{"type":"object","properties":{"documentation":{"type":"array","items":{"$ref":"#/components/schemas/model.DocumentationLink"}},"message":{"type":"string"}}},"model.DocumentationLink":{"type":"object","properties":{"text":{"type":"string"},"url":{"type":"string"}}},"model.BlueprintTags":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"model.Labels":{"type":"object"},"model.Stability":{"type":"string","enum":["development","alpha","beta","stable","deprecated",""]},"model.ConfigurationSpec":{"type":"object","properties":{"configurations":{"description":"Configurations references other Configuration resources by name.\nFor kubernetes-workload: references collector configurations to render into the CRD.\nFor kubernetes-operator: references workload configurations to package into the AgentConfigMap.","type":"array","items":{"$ref":"#/components/schemas/model.ResourceConfiguration"}},"connectors":{"type":"array","items":{"$ref":"#/components/schemas/model.ResourceConfiguration"}},"contentType":{"type":"string"},"destinations":{"type":"array","items":{"$ref":"#/components/schemas/model.ResourceConfiguration"}},"disableLegacyEnvVarNormalization":{"type":"boolean"},"extensions":{"type":"array","items":{"$ref":"#/components/schemas/model.ResourceConfiguration"}},"measurementInterval":{"type":"string"},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/model.Parameter"}},"processors":{"type":"array","items":{"$ref":"#/components/schemas/model.ResourceConfiguration"}},"raw":{"type":"string"},"rollout":{"$ref":"#/components/schemas/model.ResourceConfiguration"},"selector":{"$ref":"#/components/schemas/model.AgentSelector"},"sources":{"type":"array","items":{"$ref":"#/components/schemas/model.ResourceConfiguration"}},"topologyInterval":{"type":"string"},"type":{"description":"Type determines the type of this configuration. Built-in values: \"\" (inferred),\n\"raw\", \"modular\". Any other value is a lookup key into the ConfigurationType registry\n(e.g., \"kubernetes-workload\", \"kubernetes-operator\").","type":"string"}}},"model.ResourceConfiguration":{"type":"object","properties":{"description":{"description":"Description is the description of the resource","type":"string"},"disabled":{"type":"boolean"},"displayName":{"description":"DisplayName is a friendly name of the resource that will be displayed in the UI","type":"string"},"id":{"description":"ID will be generated and is used to uniquely identify the resource","type":"string"},"licenseEnabled":{"description":"LicenseEnabled is a flag to indicate if the resource is licensed.","type":"boolean"},"name":{"description":"Name must be specified if this is a reference to another resource by name","type":"string"},"parameters":{"type":"array","items":{"$ref":"#/components/schemas/model.Parameter"}},"presetTarget":{"description":"PresetTarget identifies the resource type that this resource preset applies to.","allOf":[{"$ref":"#/components/schemas/model.ResourcePresetTarget"}]},"processors":{"type":"array","items":{"$ref":"#/components/schemas/model.ResourceConfiguration"}},"public":{"type":"boolean"},"recommendation":{"description":"If this resource (currently only processors) was added to a configuration based on a recommendation, this field\nis set to the name of that recommendation type.","type":"string"},"routes":{"description":"Routes connect resources in a configuration","allOf":[{"$ref":"#/components/schemas/model.Routes"}]},"secOpsPipelineName":{"description":"SecOpsPipelineName is the name of the pipeline that this resource is associated with. This is used for the SecOps integration.","type":"string"},"telemetryExample":{"description":"TelemetryExample is an optional before/after example showing the transformation\na blueprint applies to telemetry data.","allOf":[{"$ref":"#/components/schemas/model.TelemetryExample"}]},"type":{"type":"string"},"version":{"type":"string"}}},"model.Parameter":{"type":"object","properties":{"credential":{"description":"Credential indicates if this parameter's value should be treated as a credential reference","type":"boolean"},"name":{"description":"Name is the name of the parameter","type":"string"},"sensitive":{"description":"Sensitive will be true if the value is sensitive and should be masked when printed.","type":"boolean"},"value":{"description":"Value could be any of the following: string, bool, int, enum (string), float, []string, map"}}},"model.ResourcePresetTarget":{"type":"object","properties":{"type":{"description":"Type is the resource type that this resource preset applies to.","type":"string"},"versionConstraint":{"description":"VersionConstraint is the constraint that allows this resource preset to only apply to specific versions.","type":"string"}}},"model.Routes":{"type":"object","properties":{"logs":{"type":"array","items":{"$ref":"#/components/schemas/model.Route"}},"logs+metrics":{"description":"pairs (alphabetical order)","type":"array","items":{"$ref":"#/components/schemas/model.Route"}},"logs+metrics+traces":{"description":"all three (alphabetical order)","type":"array","items":{"$ref":"#/components/schemas/model.Route"}},"logs+traces":{"type":"array","items":{"$ref":"#/components/schemas/model.Route"}},"metrics":{"type":"array","items":{"$ref":"#/components/schemas/model.Route"}},"metrics+traces":{"type":"array","items":{"$ref":"#/components/schemas/model.Route"}},"traces":{"type":"array","items":{"$ref":"#/components/schemas/model.Route"}}}},"model.Route":{"type":"object","properties":{"components":{"description":"Components is a list of component paths that identify a unique component in the configuration.","type":"array","items":{"type":"string"}},"id":{"description":"ID identifies this route in the routing table. It is used by the routing connector to\ncorrelate between conditions and the components connected to that condition. It is\noptional. If specified, it must be unique within the list of routes.","type":"string"}}},"model.TelemetryExample":{"type":"object","properties":{"after":{"description":"After is the structured telemetry after processing","allOf":[{"$ref":"#/components/schemas/model.TelemetryExampleEntry"}]},"before":{"description":"Before is the structured telemetry before processing","allOf":[{"$ref":"#/components/schemas/model.TelemetryExampleEntry"}]},"telemetryType":{"description":"TelemetryType indicates the kind of telemetry (e.g., \"log\", \"metric\", \"trace\")","type":"string"}}},"model.TelemetryExampleEntry":{"type":"object","properties":{"attributes":{"type":"object","additionalProperties":{}},"body":{},"observedTimestamp":{"type":"string"},"resource":{"type":"object","additionalProperties":{}},"severityNumber":{"type":"integer"},"severityText":{"type":"string"},"timestamp":{"type":"string"}}},"model.AgentSelector":{"type":"object","properties":{"matchLabels":{"$ref":"#/components/schemas/model.MatchLabels"}}},"model.MatchLabels":{"type":"object","additionalProperties":{"type":"string"}},"model.ConfigurationStatus":{"type":"object","properties":{"current":{"description":"Current will be set to true on read if the configuration is the current version","type":"boolean"},"currentVersion":{"description":"CurrentVersion is the version of the configuration that has most recently completed a rollout","allOf":[{"$ref":"#/components/schemas/model.Version"}]},"latest":{"description":"Latest will be set to true on read if the configuration is the latest version","type":"boolean"},"pending":{"description":"Pending will be set to true on read if the configuration is the pending version","type":"boolean"},"pendingVersion":{"description":"PendingVersion will be set to the version of a rollout that is in progress. It will be set to 0 when the rollout\ncompletes.","allOf":[{"$ref":"#/components/schemas/model.Version"}]},"rollout":{"description":"Rollout contains status for the rollout of this configuration","allOf":[{"$ref":"#/components/schemas/model.Rollout"}]}}},"model.Version":{"type":"integer","enum":[-2,-1,0]},"model.Rollout":{"type":"object","properties":{"completedAt":{"description":"CompletedAt is the time the rollout was completed","type":"string"},"name":{"description":"Name will be set to the Name of the configuration when requested via Configuration.Rollout()","type":"string"},"options":{"description":"Options are set when the Rollout is created based on the rollout options specified in the configuration","allOf":[{"$ref":"#/components/schemas/model.RolloutOptions"}]},"phase":{"description":"Phase starts at zero and increments until all agents are updated. In each phase, initial*multiplier^phase agents will be updated.","type":"integer"},"progress":{"description":"Progress is the current progress of the rollout. The represents the overall progress\nof the rollout. If this is a progressive rollout, this will represent the sum of all\nstages.","allOf":[{"$ref":"#/components/schemas/model.RolloutProgress"}]},"stage":{"description":"Stage is the index of the current stage of the rollout","type":"integer"},"stages":{"description":"Stages are the RolloutProgress (Completed, Errors, Incompatible, Pending, and Waiting agents), Name and Labels for each stage of a progressive Rollout","type":"array","items":{"$ref":"#/components/schemas/model.RolloutStage"}},"startedAt":{"description":"StartedAt is the time the rollout was started","type":"string"},"status":{"description":"Status is the status of the rollout","allOf":[{"$ref":"#/components/schemas/model.RolloutStatus"}]}}},"model.RolloutOptions":{"type":"object","properties":{"maxErrors":{"description":"MaxErrors is the maximum number of failed agents before the rollout will be considered an error","type":"integer"},"phaseAgentCount":{"description":"PhaseAgentCount determines the rate at which agents will be updated during a rollout.","allOf":[{"$ref":"#/components/schemas/model.PhaseAgentCount"}]}}},"model.PhaseAgentCount":{"type":"object","properties":{"initial":{"type":"integer"},"maximum":{"type":"integer"},"multiplier":{"type":"number"},"type":{"$ref":"#/components/schemas/parameters.PhaseAgentCountType"}}},"parameters.PhaseAgentCountType":{"type":"string","enum":["adaptive","custom","small","medium","large","xl","xxl"]},"model.RolloutProgress":{"type":"object","properties":{"completed":{"description":"Completed is the number of agents with new version with Connected status","type":"integer"},"errors":{"description":"Errors is the number of agents with new version with Error Status","type":"integer"},"incompatible":{"description":"Incompatible is the number of agents with new version with Incompatible Status","type":"integer"},"pending":{"description":"Pending is the number of agents that are currently being configured","type":"integer"},"waiting":{"description":"Waiting is the number of agents that need to be scheduled for configuration","type":"integer"}}},"model.RolloutStage":{"type":"object","properties":{"labels":{"description":"Agent labels that will be used to select agents to rollout to this stage","allOf":[{"$ref":"#/components/schemas/model.Labels"}]},"name":{"description":"Name of the stage","type":"string"},"progress":{"description":"Progress is the current progress of this rollout stage","allOf":[{"$ref":"#/components/schemas/model.RolloutProgress"}]},"startedAt":{"description":"StartedAt is the time the stage was started","type":"string"}}},"model.RolloutStatus":{"type":"integer","enum":[0,1,2,3,4,5]},"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}
```

## POST /agents/{id}/disconnect

> Disconnect an agent by id

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/agents/{id}/disconnect":{"post":{"tags":["agents"],"summary":"Disconnect an agent by id","parameters":[{"schema":{"type":"string"},"description":"the id of the agent","name":"id","in":"path","required":true}],"responses":{"204":{"description":"Disconnect request processed, no content"},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}}}}},"components":{"schemas":{"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}
```

## GET /agents/{id}/labels

> Get agent labels by agent id

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/agents/{id}/labels":{"get":{"tags":["agents"],"summary":"Get agent labels by agent id","parameters":[{"schema":{"type":"string"},"description":"the id of the agent","name":"id","in":"path","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.AgentLabelsResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}}}}},"components":{"schemas":{"model.AgentLabelsResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}},"labels":{"$ref":"#/components/schemas/model.Labels"}}},"model.Labels":{"type":"object"},"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}}}}}
```

## PATCH /agents/{id}/labels

> Patch agent labels by agent id

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/agents/{id}/labels":{"patch":{"tags":["agents"],"summary":"Patch agent labels by agent id","parameters":[{"schema":{"type":"string"},"description":"the id of the agent","name":"id","in":"path","required":true},{"schema":{"type":"string"},"description":"if true, overwrite any existing labels with the same names","name":"overwrite","in":"query"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.AgentLabelsResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.AgentLabelsPayload"}}},"description":"Labels to be merged with existing labels, empty values will delete existing labels","required":true}}}},"components":{"schemas":{"model.AgentLabelsResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}},"labels":{"$ref":"#/components/schemas/model.Labels"}}},"model.Labels":{"type":"object"},"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}},"model.AgentLabelsPayload":{"type":"object","properties":{"labels":{"type":"object","additionalProperties":{"type":"string"}}}}}}}
```

## POST /agents/{id}/version

> Upgrade agent

```json
{"openapi":"3.1.1","info":{"title":"","version":"0.0.1"},"servers":[{"url":"/v1"}],"paths":{"/agents/{id}/version":{"post":{"tags":["agents"],"summary":"Upgrade agent","parameters":[{"schema":{"type":"string"},"description":"the id of the agent","name":"id","in":"path","required":true}],"responses":{"204":{"description":"Upgrade request processed, no content"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"409":{"description":"If the agent does not support upgrade","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"412":{"description":"If the agent is disconnected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/model.PostAgentVersionRequest"}}},"description":"request body containing version","required":true}}}},"components":{"schemas":{"model.ErrorResponse":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}}},"model.PostAgentVersionRequest":{"type":"object","properties":{"version":{"type":"string"}}}}}}
```
