Documentation ¶
Overview ¶
Package agent contains all functionalities related to Phobos agents, which are responsible for claiming and running jobs.
Index ¶
- func RequireViewerAccessToAgentResource(ctx context.Context, agent *models.Agent) error
- type AssignServiceAccountToAgentInput
- type CreateAgentInput
- type CreateAgentSessionInput
- type DeleteAgentInput
- type GetAgentSessionsInput
- type GetAgentsInput
- type Service
- type SessionEvent
- type SubscribeToAgentSessionErrorLogInput
- type SubscribeToAgentSessionsInput
- type UnassignServiceAccountFromAgentInput
- type UpdateAgentInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AssignServiceAccountToAgentInput ¶
AssignServiceAccountToAgentInput is the input for assigning a service account to an agent
type CreateAgentInput ¶
type CreateAgentInput struct { OrganizationID *string Type models.AgentType Name string Description string Tags []string Disabled bool RunUntaggedJobs bool }
CreateAgentInput is the input for creating a new agent
type CreateAgentSessionInput ¶
CreateAgentSessionInput is the input for creating a new agent session
type DeleteAgentInput ¶
DeleteAgentInput is the input for deleting an existing agent
type GetAgentSessionsInput ¶
type GetAgentSessionsInput struct { // Sort specifies the field to sort on and direction Sort *db.AgentSessionSortableField // PaginationOptions supports cursor based pagination PaginationOptions *pagination.Options // AgentID is the agent to return sessions for AgentID string }
GetAgentSessionsInput is the input for querying a list of agent sessions
type GetAgentsInput ¶
type GetAgentsInput struct { // Sort specifies the field to sort on and direction Sort *db.AgentSortableField // PaginationOptions supports cursor based pagination PaginationOptions *pagination.Options // OrganizationID is the organization to return agents for OrganizationID *string // AgentType is the type of agent to return AgentType *models.AgentType }
GetAgentsInput is the input for querying a list of agents
type Service ¶
type Service interface { GetAgentByID(ctx context.Context, id string) (*models.Agent, error) GetAgentByPRN(ctx context.Context, prn string) (*models.Agent, error) GetAgentsByIDs(ctx context.Context, idList []string) ([]models.Agent, error) GetAgents(ctx context.Context, input *GetAgentsInput) (*db.AgentsResult, error) CreateAgent(ctx context.Context, input *CreateAgentInput) (*models.Agent, error) UpdateAgent(ctx context.Context, input *UpdateAgentInput) (*models.Agent, error) DeleteAgent(ctx context.Context, input *DeleteAgentInput) error AssignServiceAccountToAgent(ctx context.Context, input *AssignServiceAccountToAgentInput) error UnassignServiceAccountFromAgent(ctx context.Context, input *UnassignServiceAccountFromAgentInput) error CreateAgentSession(ctx context.Context, input *CreateAgentSessionInput) (*models.AgentSession, error) GetAgentSessions(ctx context.Context, input *GetAgentSessionsInput) (*db.AgentSessionsResult, error) GetAgentSessionByID(ctx context.Context, id string) (*models.AgentSession, error) GetAgentSessionByPRN(ctx context.Context, prn string) (*models.AgentSession, error) AcceptAgentSessionHeartbeat(ctx context.Context, sessionID string) error CreateAgentSessionError(ctx context.Context, agentSessionID string, message string) error ReadAgentSessionErrorLog(ctx context.Context, agentSessionID string, startOffset int, limit int) ([]byte, error) SubscribeToAgentSessionErrorLog(ctx context.Context, options *SubscribeToAgentSessionErrorLogInput) (<-chan *logstream.LogEvent, error) GetLogStreamsByAgentSessionIDs(ctx context.Context, idList []string) ([]models.LogStream, error) SubscribeToAgentSessions(ctx context.Context, options *SubscribeToAgentSessionsInput) (<-chan *SessionEvent, error) }
Service implements all agent related functionality
func NewService ¶
func NewService( logger logger.Logger, dbClient *db.Client, limitChecker limits.LimitChecker, logStreamManager logstream.Manager, eventManager *events.EventManager, activityService activityevent.Service, ) Service
NewService creates an instance of Service
type SessionEvent ¶
type SessionEvent struct { AgentSession *models.AgentSession Action string }
SessionEvent is an agent session event
type SubscribeToAgentSessionErrorLogInput ¶
SubscribeToAgentSessionErrorLogInput includes options for setting up a log event subscription
type SubscribeToAgentSessionsInput ¶
type SubscribeToAgentSessionsInput struct { OrganizationID *string AgentID *string AgentType *models.AgentType }
SubscribeToAgentSessionsInput is the input for subscribing to agent sessions
type UnassignServiceAccountFromAgentInput ¶
UnassignServiceAccountFromAgentInput is the input for un-assigning a service account from an agent