Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions workspaces/dcm/.changeset/replace-providers-with-agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
'@red-hat-developer-hub/backstage-plugin-dcm': major
'@red-hat-developer-hub/backstage-plugin-dcm-common': major
---

Replace Providers tab with Agents tab.

**BREAKING CHANGES**

The following `@public` exports have been removed:

- `@red-hat-developer-hub/backstage-plugin-dcm-common`: `ProvidersApi`, `ProvidersClient`, `Provider`, `ProviderList`, `ProviderMetadata`, `ProviderStatus`, `ResourceCapacity`
- `@red-hat-developer-hub/backstage-plugin-dcm`: `providersApiRef`

These symbols were removed because the Providers API has been deprecated by the
DCM API team and is no longer available.

**Note:** DCM 1.x has no production consumers at this time.

---

A new Agents tab has been added as the default landing tab, backed by the
Agent API (v1alpha1). Agents register with the control plane and send periodic
heartbeats. The UI supports listing agents with health-status filtering and
registering new agents.

**Follow-up**: FLPATH-4773 — rename the Resources tab "Provider" column to
"Environment" once the Resources API replaces `provider_name` with an agent
reference, and mark resources as degraded when the associated agent is
unavailable.
177 changes: 86 additions & 91 deletions workspaces/dcm/plugins/dcm-common/report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,86 @@ import { BasicPermission } from '@backstage/plugin-permission-common';
import type { DiscoveryApi } from '@backstage/core-plugin-api';
import type { FetchApi } from '@backstage/core-plugin-api';

// @public
export interface Agent {
agent_id?: string;
cost: AgentCost;
create_time?: string;
environment: string;
health_status?: AgentHealthStatus;
last_heartbeat?: string;
name: string;
service_types: string[];
topic_name: string;
update_time?: string;
}

// @public
export type AgentCost =
| 'low'
| 'medium-low'
| 'medium'
| 'medium-high'
| 'high';

// @public
export type AgentHealthStatus = 'ready' | 'congested' | 'unavailable';

// @public
export interface AgentList {
// (undocumented)
agents?: Agent[];
// (undocumented)
next_page_token?: string;
}

// @public
export interface AgentRegistrationRequest {
// (undocumented)
cost: AgentCost;
// (undocumented)
environment: string;
// (undocumented)
name: string;
// (undocumented)
service_types: string[];
topic_name: string;
}

// @public
export interface AgentsApi {
// (undocumented)
agentHeartbeat(agentId: string, heartbeat: HeartbeatRequest): Promise<Agent>;
// (undocumented)
createAgent(agent: AgentRegistrationRequest): Promise<Agent>;
// (undocumented)
getAgent(agentId: string): Promise<Agent>;
// (undocumented)
listAgents(
params?: PaginationParams & {
health_status?: AgentHealthStatus;
},
): Promise<AgentList>;
}

// @public
export class AgentsClient extends DcmBaseClient implements AgentsApi {
// (undocumented)
agentHeartbeat(agentId: string, heartbeat: HeartbeatRequest): Promise<Agent>;
// (undocumented)
createAgent(agent: AgentRegistrationRequest): Promise<Agent>;
// (undocumented)
getAgent(agentId: string): Promise<Agent>;
// (undocumented)
listAgents(
params?: PaginationParams & {
health_status?: AgentHealthStatus;
},
): Promise<AgentList>;
// (undocumented)
protected readonly serviceName = 'Agents';
}

// @public
export function buildPaginationQuery(params: PaginationParams): string;

Expand Down Expand Up @@ -282,6 +362,12 @@ export interface FieldConfigurationDependsOn {
path: string;
}

// @public
export interface HeartbeatRequest {
consumer_lag: number;
timestamp: string;
}

// @public
export interface ListServiceTypeInstancesParams {
max_page_size?: number;
Expand Down Expand Up @@ -364,97 +450,6 @@ export class PolicyManagerClient
// @public
export type PolicyType = 'GLOBAL' | 'USER';

// @public
export interface Provider {
// (undocumented)
create_time?: string;
// (undocumented)
display_name?: string;
endpoint: string;
// (undocumented)
health_status?: string;
id?: string;
// (undocumented)
metadata?: ProviderMetadata;
// (undocumented)
name: string;
operations?: string[];
path?: string;
schema_version: string;
// (undocumented)
service_type: string;
status?: ProviderStatus;
// (undocumented)
update_time?: string;
}

// @public
export interface ProviderList {
// (undocumented)
next_page_token?: string;
// (undocumented)
providers?: Provider[];
}

// @public
export interface ProviderMetadata {
// (undocumented)
[key: string]: unknown;
// (undocumented)
region_code?: string;
// (undocumented)
resources?: ResourceCapacity;
// (undocumented)
status?: string;
// (undocumented)
zone?: string;
}

// @public
export interface ProvidersApi {
// (undocumented)
applyProvider(providerId: string, provider: Provider): Promise<Provider>;
// (undocumented)
createProvider(provider: Provider): Promise<Provider>;
// (undocumented)
deleteProvider(providerId: string): Promise<void>;
// (undocumented)
getProvider(providerId: string): Promise<Provider>;
// (undocumented)
listProviders(params?: PaginationParams): Promise<ProviderList>;
}

// @public
export class ProvidersClient extends DcmBaseClient implements ProvidersApi {
// (undocumented)
applyProvider(providerId: string, provider: Provider): Promise<Provider>;
// (undocumented)
createProvider(provider: Provider): Promise<Provider>;
// (undocumented)
deleteProvider(providerId: string): Promise<void>;
// (undocumented)
getProvider(providerId: string): Promise<Provider>;
// (undocumented)
listProviders(params?: PaginationParams): Promise<ProviderList>;
// (undocumented)
protected readonly serviceName = 'Providers';
}

// @public
export type ProviderStatus = 'registered' | 'updated';

// @public
export interface ResourceCapacity {
// (undocumented)
total_cpu?: number;
// (undocumented)
total_memory?: string;
// (undocumented)
total_node?: number;
// (undocumented)
total_storage?: string;
}

// @public
export interface ResourcesApi {
listServiceTypeInstances(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,24 @@
*/

import type { PaginationParams } from '../types/common';
import type { Provider, ProviderList } from '../types/providers';
import type {
Agent,
AgentHealthStatus,
AgentList,
AgentRegistrationRequest,
HeartbeatRequest,
} from '../types/agents';

/**
* Interface for the DCM Providers API client.
* Interface for the DCM Agents API client.
*
* @public
*/
export interface ProvidersApi {
listProviders(params?: PaginationParams): Promise<ProviderList>;
getProvider(providerId: string): Promise<Provider>;
createProvider(provider: Provider): Promise<Provider>;
applyProvider(providerId: string, provider: Provider): Promise<Provider>;
deleteProvider(providerId: string): Promise<void>;
export interface AgentsApi {
listAgents(
params?: PaginationParams & { health_status?: AgentHealthStatus },
): Promise<AgentList>;
getAgent(agentId: string): Promise<Agent>;
createAgent(agent: AgentRegistrationRequest): Promise<Agent>;
agentHeartbeat(agentId: string, heartbeat: HeartbeatRequest): Promise<Agent>;
}
Loading
Loading