Documentation
¶
Overview ¶
Package apptool is the manage_application MCP tool (#2411, #2412): an application's record, parts, releases, rollbacks, and its export and import between deployments, over the one service the portal routes use.
Index ¶
Constants ¶
View Source
const ( CmdCreate = "create" CmdGet = "get" CmdList = "list" CmdUpdate = "update" CmdDelete = "delete" CmdAddPart = "add_part" CmdRemovePart = "remove_part" CmdSetPart = "set_part" CmdRelease = "release" CmdRollback = "rollback" CmdReleases = "releases" CmdExport = "export" CmdImport = "import" // Environments and variables (#2696). CmdPromote = "promote" CmdAddEnvironment = "add_environment" CmdRemoveEnvironment = "remove_environment" CmdSetEnvironment = "set_environment" CmdVariables = "variables" CmdSetVariable = "set_variable" CmdDeleteVariable = "delete_variable" )
The commands.
View Source
const ToolName = "manage_application"
ToolName is the tool's name.
Variables ¶
View Source
var Commands = []string{ CmdCreate, CmdGet, CmdList, CmdUpdate, CmdDelete, CmdAddPart, CmdRemovePart, CmdSetPart, CmdRelease, CmdRollback, CmdReleases, CmdExport, CmdImport, CmdPromote, CmdAddEnvironment, CmdRemoveEnvironment, CmdSetEnvironment, CmdVariables, CmdSetVariable, CmdDeleteVariable, }
Commands is every command, in the order the schema lists them.
View Source
var Reads = []string{CmdGet, CmdList, CmdReleases}
Reads is the commands that change nothing.
Functions ¶
This section is empty.
Types ¶
type Bundles ¶
type Bundles interface {
Export(ctx context.Context, actor application.Actor, ref string, release int) (any, error)
Import(ctx context.Context, actor application.Actor, bundle string, mapping map[string]string) (any, error)
}
Bundles exports and imports applications; nil on a deployment that cannot.
type Input ¶
type Input struct {
Command string `json:"command"`
Application string `json:"application,omitempty"`
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
Connection string `json:"connection,omitempty"`
Schema string `json:"schema,omitempty"`
OwnerEmail string `json:"owner_email,omitempty"`
Kind string `json:"kind,omitempty"`
PartID string `json:"part_id,omitempty"`
Note string `json:"note,omitempty"`
ToRelease int `json:"to_release,omitempty"`
Release int `json:"release,omitempty"`
// Bundle is the managed resource an import reads, by id or URI.
Bundle string `json:"bundle,omitempty"`
// Map names, for each connection and secret the bundle names, the one on
// this deployment it becomes.
Map map[string]string `json:"map,omitempty"`
// ReleaseMode is a site part's: linked or coupled (#2679).
ReleaseMode string `json:"release_mode,omitempty"`
// ContractVersion is what update sets the application's contract to.
ContractVersion *int `json:"contract_version,omitempty"`
// Contract is the contract version a release declares.
Contract *int `json:"contract,omitempty"`
// MoveSites are the site parts a release moves besides the coupled ones.
MoveSites []string `json:"move_sites,omitempty"`
// Force releases over a site part that does not accept the contract.
Force bool `json:"force,omitempty"`
// Environment is the environment promote moves from, rollback moves
// back, and a variable belongs to ("" its default); After is where
// add_environment puts one; RequiresApproval is whether an agent's
// promote or rollback into it is refused for a person to carry out
// (#2696).
Environment string `json:"environment,omitempty"`
After string `json:"after,omitempty"`
RequiresApproval *bool `json:"requires_approval,omitempty"`
// Variable and Value are set_variable's NAME=value.
Variable string `json:"variable,omitempty"`
Value string `json:"value,omitempty"`
}
Input is the tool's arguments.
Click to show internal directories.
Click to hide internal directories.